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 and xavier-dass committed Sep 26, 2019
1 parent b819ca5 commit 87b06f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sale_automatic_workflow/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields
from odoo import models, fields, api


class AccountInvoice(models.Model):
Expand All @@ -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 87b06f5

Please sign in to comment.