From 696e8095cc67cda2296f93ffbe233c533ff1e365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 5 Aug 2023 00:27:11 +0200 Subject: [PATCH] Try to post only clearing move of journals from the contextual company Closes #12453 (grafted from b71b06a871a7fb67a202f1ae242a04185078c614) --HG-- branch : 6.0 --- modules/account_payment_clearing/payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account_payment_clearing/payment.py b/modules/account_payment_clearing/payment.py index 5492145e14..38402ff0c9 100644 --- a/modules/account_payment_clearing/payment.py +++ b/modules/account_payment_clearing/payment.py @@ -41,6 +41,7 @@ class Journal(metaclass=PoolMeta): date = Date.today() moves = [] journals = cls.search([ + ('company', '=', Transaction().context.get('company')), ('clearing_posting_delay', '!=', None), ]) for journal in journals: @@ -50,7 +51,7 @@ class Journal(metaclass=PoolMeta): ('origin.journal.id', '=', journal.id, 'account.payment'), ('state', '=', 'draft'), - ('company', '=', Transaction().context.get('company')), + ('company', '=', journal.company.id), ])) Move.post(moves)