From 23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 21 Jul 2010 14:34:31 +0530 Subject: [PATCH] [IMP] account :Fix the problem of type in profit and loss report bzr revid: sbh@tinyerp.com-20100721090431-mv151ees6uhtibua --- addons/account/report/report_pl.py | 20 ++++++++++---------- addons/account/report/report_pl_account.rml | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/account/report/report_pl.py b/addons/account/report/report_pl.py index d11cd8470e5..334faedf1d5 100644 --- a/addons/account/report/report_pl.py +++ b/addons/account/report/report_pl.py @@ -83,7 +83,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): self.result_sum_cr += self.res_pl['balance'] return self.result_sum_cr or 0.0 - def get_data(self, form): + def get_data(self, data): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname) @@ -98,16 +98,16 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): ctx = self.context.copy() # ctx['state'] = form['context'].get('state','all') - ctx['fiscalyear'] = form['fiscalyear'] + ctx['fiscalyear'] = data['form']['fiscalyear_id'] - if form['filter']=='filter_period' : - ctx['periods'] = form['periods'] - elif form['filter']== 'filter_date': - ctx['date_from'] = form['date_from'] - ctx['date_to'] = form['date_to'] + if data['form']['filter']=='filter_period' : + ctx['periods'] = data['periods'] + elif data['form']['filter']== 'filter_date': + ctx['date_from'] = data['date_from'] + ctx['date_to'] = data['date_to'] cal_list={} - account_id = [form['Account_list']] + account_id =data['form']['chart_account_id'] account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx) accounts = account_pool.browse(cr, uid, account_ids, context=ctx) @@ -119,10 +119,10 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): self.result_sum_dr += abs(account.debit - account.credit) if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit): self.result_sum_cr += abs(account.debit - account.credit) - if form['display_account'] == 'bal_mouvement': + if data['form']['display_account'] == 'bal_mouvement': if account.credit > 0 or account.debit > 0 or account.balance > 0 : accounts_temp.append(account) - elif form['display_account'] == 'bal_solde': + elif data['form']['display_account'] == 'bal_solde': if account.balance != 0: accounts_temp.append(account) else: diff --git a/addons/account/report/report_pl_account.rml b/addons/account/report/report_pl_account.rml index a2041d46e4a..296b821f764 100644 --- a/addons/account/report/report_pl_account.rml +++ b/addons/account/report/report_pl_account.rml @@ -198,7 +198,7 @@ - [[ get_data(data['form']) or removeParentNode('para')]] + [[ get_data(data) or removeParentNode('para')]] @@ -284,7 +284,7 @@ [[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]] - [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(final_result()['balance']) or 0.0 ]] @@ -294,7 +294,7 @@ Total:([[ get_currency(data) ]]) - [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]] + [[ sum_dr() and formatLang(sum_dr()) or 0.0 ]]