From 20a3f53d2b302e0106651b879d42ef9a4b7337df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 26 Jul 2024 23:25:02 +0200 Subject: [PATCH] Do not filter with context lines for aged balance Closes #12210 --- modules/account/account.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/account/account.py b/modules/account/account.py index fa86c679d6..7e9702764d 100644 --- a/modules/account/account.py +++ b/modules/account/account.py @@ -3011,8 +3011,6 @@ class AgedBalance(ModelSQL, ModelView): company_id = context.get('company') date = context.get('date') - with Transaction().set_context(date=None): - line_query, _ = MoveLine.query_get(line) kind = cls.get_kind(type_) debit_kind = ( cls.get_kind(debit_type) @@ -3066,8 +3064,7 @@ class AgedBalance(ModelSQL, ModelView): & ((line.reconciliation == Null) | (reconciliation.date > date)) & (move.date <= date) - & (account.company == company_id) - & line_query, + & (account.company == company_id), group_by=(line.party, move.company)) @classmethod