mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
@@ -68,11 +68,15 @@ class StockMove(models.Model):
|
||||
return super(StockMove, self).copy_data(default)
|
||||
|
||||
def _action_cancel(self):
|
||||
"""Apply sudo to prevent requests ACL errors if the user does not have
|
||||
permissions (example: productions)."""
|
||||
res = super()._action_cancel()
|
||||
self.mapped("allocation_ids.stock_request_id").check_cancel()
|
||||
self.mapped("allocation_ids.stock_request_id").sudo().check_cancel()
|
||||
return res
|
||||
|
||||
def _action_done(self, cancel_backorder=False):
|
||||
"""Apply sudo to prevent requests ACL errors if the user does not have
|
||||
permissions (example: productions)."""
|
||||
res = super()._action_done(cancel_backorder=cancel_backorder)
|
||||
self.mapped("allocation_ids.stock_request_id").check_done()
|
||||
self.mapped("allocation_ids.stock_request_id").sudo().check_done()
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user