From 865be2a1b8367dd4bc9fb5da470e0c0e8078c98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 21 Sep 2012 15:00:25 +0200 Subject: [PATCH] Fix balance computation and debit/credit for TrialBalance To compute accumulate previous fiscalyear, dates must be reset and to not compute accumulate fiscalyear must not be set. review507003 (transplanted from de306827fd64d40828ba8221f943b7fc552a69a8) --- account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/account.py b/account.py index 700ab97e01..984c6c2830 100644 --- a/account.py +++ b/account.py @@ -718,7 +718,7 @@ class Account(ModelSQL, ModelView): res[account_id] += deferral.debit - deferral.credit else: with Transaction().set_context(fiscalyear=fiscalyear.id, - date=None): + date=None, periods=None): res2 = self.get_balance(ids, name) for account_id in ids: res[account_id] += res2[account_id] @@ -818,7 +818,7 @@ class Account(ModelSQL, ModelView): res[name][account_id] += deferral[name] else: with Transaction().set_context(fiscalyear=fiscalyear.id, - date=None): + date=None, dates=None): res2 = self.get_credit_debit(ids, names) for account_id in ids: for name in names: @@ -1418,7 +1418,7 @@ class TrialBalance(Report): set(start_period_ids))) with Transaction().set_context( - fiscalyear=data['fiscalyear'], + fiscalyear=None, periods=end_period_ids, posted=data['posted']): accounts = account_obj.browse(account_ids)