From fc7f329a1a1cda7414ac59f7b4faa5ec069852ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 1 Apr 2022 23:45:37 +0200 Subject: [PATCH] Use from_date and to_date for the debit/credit context Using get_dates is wrong because it provides the range for the start balance which is one day before. issue11322 review390271002 --- account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/account.py b/account.py index 30a78f7506..0c0164c028 100644 --- a/account.py +++ b/account.py @@ -1994,9 +1994,9 @@ class _GeneralLedgerAccount(ActivePeriodMixin, ModelSQL, ModelView): start_period_ids = set(cls.get_period_ids('start_balance')) end_period_ids = set(cls.get_period_ids('end_balance')) period_ids = list(end_period_ids.difference(start_period_ids)) - elif context.get('from_date') or context.get('end_date'): - _, from_date = cls.get_dates('start_balance') - _, to_date = cls.get_dates('end_balance') + elif context.get('from_date') or context.get('to_date'): + from_date = context.get('from_date') + to_date = context.get('to_date') return { 'periods': period_ids, 'from_date': from_date,