From 36e79216ab442ddee4b5543a68a88969a2def7e1 Mon Sep 17 00:00:00 2001 From: marwen Date: Thu, 3 Aug 2023 09:54:23 +0200 Subject: [PATCH 1/2] account_payment_clearing: add a hook on succeed payments method --- modules/account_payment_clearing/payment.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/account_payment_clearing/payment.py b/modules/account_payment_clearing/payment.py index 90a3f2b3975..0677070b56e 100644 --- a/modules/account_payment_clearing/payment.py +++ b/modules/account_payment_clearing/payment.py @@ -163,7 +163,6 @@ def succeed_wizard(cls, payments): def succeed(cls, payments): pool = Pool() Move = pool.get('account.move') - Line = pool.get('account.move.line') super(Payment, cls).succeed(payments) @@ -177,7 +176,11 @@ def succeed(cls, payments): Move.save(moves) cls.write(*sum((([m.origin], {'clearing_move': m.id}) for m in moves), ())) + cls.reconcile_lines_from_payments(payments) + @classmethod + def reconcile_lines_from_payments(cls, payments): + Line = Pool().get('account.move.line') to_reconcile = [] for payment in payments: if (payment.line From 07b24deefad9907c5dbdf06783a148c5500a36bb Mon Sep 17 00:00:00 2001 From: marwen Date: Thu, 10 Aug 2023 11:05:15 +0200 Subject: [PATCH 2/2] rename mehtod --- modules/account_payment_clearing/payment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/account_payment_clearing/payment.py b/modules/account_payment_clearing/payment.py index 0677070b56e..7bf7440a3fb 100644 --- a/modules/account_payment_clearing/payment.py +++ b/modules/account_payment_clearing/payment.py @@ -176,10 +176,10 @@ def succeed(cls, payments): Move.save(moves) cls.write(*sum((([m.origin], {'clearing_move': m.id}) for m in moves), ())) - cls.reconcile_lines_from_payments(payments) + cls._reconcile_lines_from_payments(payments) @classmethod - def reconcile_lines_from_payments(cls, payments): + def _reconcile_lines_from_payments(cls, payments): Line = Pool().get('account.move.line') to_reconcile = [] for payment in payments: