diff --git a/modules/account_invoice/invoice.py b/modules/account_invoice/invoice.py index 631d9975e7..3a4ba4e499 100644 --- a/modules/account_invoice/invoice.py +++ b/modules/account_invoice/invoice.py @@ -436,8 +436,11 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): if self.company: return self.company.party.id - @fields.depends('party', 'type', 'accounting_date', 'invoice_date') + @fields.depends( + 'state', 'account', 'party', 'type', 'accounting_date', 'invoice_date') def on_change_with_account(self): + if self.state != 'draft': + return self.account account = None if self.party: with Transaction().set_context(