[FIX] sale_purchase: change to _action_cancel
An activity should be posted only when a SO is cancelled, this happens after _action_cancel as action_cancel doesn't always cancel the order. sale_purchase was forgotten in commit 7c8f15d4141d4ae130da59d58ee2eaff39e363c4 closes odoo/odoo#81569 Related: odoo/enterprise#26866 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -23,8 +23,8 @@ class SaleOrder(models.Model):
|
||||
order.order_line.sudo()._purchase_service_generation()
|
||||
return result
|
||||
|
||||
def action_cancel(self):
|
||||
result = super(SaleOrder, self).action_cancel()
|
||||
def _action_cancel(self):
|
||||
result = super()._action_cancel()
|
||||
# When a sale person cancel a SO, he might not have the rights to write
|
||||
# on PO. But we need the system to create an activity on the PO (so 'write'
|
||||
# access), hence the `sudo`.
|
||||
|
||||
Reference in New Issue
Block a user