changeset 4d5907ef3457 in modules/sale_payment:default
details: 
https://hg.tryton.org/modules/sale_payment?cmd=changeset&node=4d5907ef3457
description:
        Clear payment account when setting line

        issue11131
        review391401002
diffstat:

 account.py |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r a15f5a4de9db -r 4d5907ef3457 account.py
--- a/account.py        Sat Dec 18 16:34:36 2021 +0100
+++ b/account.py        Thu Jan 20 19:07:43 2022 +0100
@@ -138,8 +138,13 @@
                     continue
                 if payment.party != line.party:
                     continue
+                if (getattr(payment, 'account')
+                        and payment.account != line.account):
+                    continue
                 if payment.amount <= payment_amount:
                     payment.line = line
+                    if hasattr(payment, 'account'):
+                        payment.account = None
                     payment_amount -= payment.amount
         return payments
 

Reply via email to