From e3e8847c3c048f979fd493fba4e4afeef456ffaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 8 Apr 2023 14:31:25 +0200 Subject: [PATCH] Use dates from context to compute account type amount The general ledger dates are not good because they are defined to compute a start and end amount. Closes #12162 --- modules/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/account/account.py b/modules/account/account.py index b9a559aa20..09ea6fe566 100644 --- a/modules/account/account.py +++ b/modules/account/account.py @@ -327,8 +327,8 @@ class Type( period_ids = list( set(end_period_ids).difference(set(start_period_ids))) elif context.get('from_date') or context.get('to_date'): - from_date, _ = GeneralLedger.get_dates('start_%s' % name) - _, to_date = GeneralLedger.get_dates('end_%s' % name) + from_date = context.get('from_date') + to_date = context.get('to_date') with Transaction().set_context( periods=period_ids, from_date=from_date, to_date=to_date):