Skip to content

Commit

Permalink
[12.0][FIX] action_cancel resets the workflow
Browse files Browse the repository at this point in the history
If someone cancel the invoice reset the "automated workflow" to null to make sure it is not processed anymore.
  • Loading branch information
SodexisTeam authored Sep 25, 2019
1 parent b819ca5 commit 670664e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sale_automatic_workflow/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ class AccountInvoice(models.Model):
comodel_name='sale.workflow.process',
string='Sale Workflow Process'
)

@api.multi
def action_cancel(self):
for inv in self:
if inv.workflow_process_id:
inv.workflow_process_id = None
return super(AccountInvoice, self).action_cancel()

0 comments on commit 670664e

Please sign in to comment.