changeset 0a983bf1578f in modules/account_payment_clearing:default
details: 
https://hg.tryton.org/modules/account_payment_clearing?cmd=changeset;node=0a983bf1578f
description:
        Set clearing account when payment or group is set

        issue9164
        review303101006
diffstat:

 statement.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 1b86b11c3c2c -r 0a983bf1578f statement.py
--- a/statement.py      Fri Mar 20 19:10:30 2020 +0100
+++ b/statement.py      Mon Mar 30 09:42:10 2020 +0200
@@ -119,7 +119,7 @@
             if not self.party:
                 self.party = self.payment.party
             clearing_account = self.payment.journal.clearing_account
-            if not self.account and clearing_account:
+            if clearing_account and self.account != clearing_account:
                 self.account = clearing_account
             if self.statement and self.statement.journal:
                 with Transaction().set_context(date=self.payment.date):
@@ -134,7 +134,7 @@
         if self.payment_group:
             self.party = None
             clearing_account = self.payment_group.journal.clearing_account
-            if not self.account and clearing_account:
+            if clearing_account and self.account != clearing_account:
                 self.account = clearing_account
 
     @fields.depends('party', 'payment')

Reply via email to