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
This commit is contained in:
Cédric Krier
2023-04-08 14:31:25 +02:00
parent 83b8037eca
commit e3e8847c3c
+2 -2
View File
@@ -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):