Add patch to fix journal issue12271.diff

This commit is contained in:
Albert Cervera i Areny 2023-05-14 16:14:13 +02:00
parent 378b59f09f
commit 29ca6c612f
2 changed files with 25 additions and 1 deletions

22
issue12271.diff Normal file
View File

@ -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

4
series
View File

@ -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