From ce041c78bde1c732548a57578ca76b20aafa3c10 Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Thu, 20 Jun 2013 12:55:25 -0530 Subject: [PATCH] [IMP] using debit and credit to get balance and reduce time consumption --- account_financial_report/report/parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/account_financial_report/report/parser.py b/account_financial_report/report/parser.py index 077169d9..9e5336fa 100644 --- a/account_financial_report/report/parser.py +++ b/account_financial_report/report/parser.py @@ -461,7 +461,14 @@ class account_balance(report_sxw.rml_parse): #~ Black dict_black = {} for i in account_black: - dict_black[i.id] = {'obj': i, 'debit': i.debit, 'credit':i.credit, 'balance': i.balance } + d = i.debit + c = i.credit + dict_black[i.id] = { + 'obj': i, + 'debit': d, + 'credit': c, + 'balance': d-c + } if form['inf_type'] == 'BS': dict_black.get(i.id)['balanceinit'] = 0.0