From f5f0cdc09bba123d49894fe9edd0248f4b2aabfa 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 (grafted from 428746eda064bb89c4b1945cdc778efe2d7b7557) --HG-- branch : 7.0 --- 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 804f659999..f044353ed9 100644 --- a/modules/account/account.py +++ b/modules/account/account.py @@ -2937,8 +2937,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) @@ -2992,8 +2990,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