From ab493505e0d75b7acf28f517cfa7b874331d8cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 14 Jul 2009 12:59:30 +0200 Subject: [PATCH] Fix computation of end amounts in General Ledger for issue1108 --- account.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account.py b/account.py index 3cf11dc4c8..7f2606724c 100644 --- a/account.py +++ b/account.py @@ -1066,14 +1066,12 @@ class GeneralLegder(Report): ('fiscalyear', '=', datas['form']['fiscalyear']), ('end_date', '<=', end_period.start_date), ], context=context) - end_period_ids = exclude(end_period_ids, start_period_ids) if datas['form']['end_period'] not in end_period_ids: end_period_ids.append(datas['form']['end_period']) else: end_period_ids = period_obj.search(cursor, user, [ ('fiscalyear', '=', datas['form']['fiscalyear']), ], context=context) - end_period_ids = exclude(end_period_ids, start_period_ids) end_context = context.copy() end_context['fiscalyear'] = datas['form']['fiscalyear'] @@ -1098,7 +1096,8 @@ class GeneralLegder(Report): context['id2end_account'] = id2end_account context['digits'] = company.currency.digits context['lines'] = lambda account_id: self.lines(cursor, user, - account_id, end_period_ids, datas['form']['posted'], context) + account_id, list(set(end_period_ids).difference( + set(start_period_ids))), datas['form']['posted'], context) context['company'] = company return super(GeneralLegder, self).parse(cursor, user, report, objects,