diff --git a/issue12271.diff b/issue12271.diff new file mode 100644 index 0000000..b2cc378 --- /dev/null +++ b/issue12271.diff @@ -0,0 +1,22 @@ +diff --git a/tryton/modules/account_invoice/invoice.py b/tryton/modules/account_invoice/invoice.py +--- a/tryton/modules/account_invoice/invoice.py ++++ b/tryton/modules/account_invoice/invoice.py +@@ -514,11 +514,14 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): + Journal = pool.get('account.journal') + if self.state != 'draft': + return self.journal ++ journal_type = { ++ 'out': 'revenue', ++ 'in': 'expense', ++ }.get(self.type) ++ if self.journal and self.journal.type == journal_type: ++ return self.journal + pattern = pattern.copy() if pattern is not None else {} +- pattern.setdefault('type', { +- 'out': 'revenue', +- 'in': 'expense', +- }.get(self.type)) ++ pattern.setdefault('type', journal_type) + return Journal.find(pattern) + + @classmethod diff --git a/series b/series index 87538e7..c9ea824 100644 --- a/series +++ b/series @@ -31,4 +31,6 @@ counterpart_party_payment_clearing.diff # [account_payment_clearing] Add the pos issue11966.diff # [sao] Overlap label links in form view -issue12263-issue12239.diff # [account_invoice] Can't set invoice journal to null or other journal + Set invoice account only when changing party or dates +#issue12263-issue12239.diff # [account_invoice] Can't set invoice journal to null or other journal + Set invoice account only when changing party or dates + +issue12271.diff # [acocunt_invoice] Cannot change invoice journal