From b87a568d472aa9726dd047ffae0028b05e073e38 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 21 Jul 2010 16:02:59 +0530 Subject: [PATCH] [IMP] account: Improve the central_journal report bzr revid: sbh@tinyerp.com-20100721103259-x213zmioqr84r66w --- addons/account/report/central_journal.py | 12 ------------ addons/account/report/central_journal.rml | 16 ++++++++-------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py index 1b587ee411a..35792214239 100644 --- a/addons/account/report/central_journal.py +++ b/addons/account/report/central_journal.py @@ -80,18 +80,6 @@ class journal_print(report_sxw.rml_parse, common_report_header): else: self.account_currency = False - def _sum_currency_amount_account(self, account, form): - self._set_get_account_currency_code(account.id) - self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,)) - total = self.cr.fetchone() - - if self.account_currency: - return_field = str(total[0]) + self.account_currency - return return_field - else: - currency_total = self.tot_currency = 0.0 - return currency_total - def _get_account(self, data): if data['model']=='account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name diff --git a/addons/account/report/central_journal.rml b/addons/account/report/central_journal.rml index 1294f0e52fd..89f498605f6 100644 --- a/addons/account/report/central_journal.rml +++ b/addons/account/report/central_journal.rml @@ -306,7 +306,7 @@ - [[ print_data(data) == False or removeParentNode('blockTable') ]] + [[ print_data(data) == False or removeParentNode('blockTable') ]] A/C No. Account Name @@ -315,7 +315,7 @@ Balance - [[ print_data(data) or removeParentNode('blockTable') ]] + [[ print_data(data) or removeParentNode('blockTable') ]] A/C No. Account Name @@ -328,7 +328,7 @@ - [[ print_data(data) == False or removeParentNode('blockTable') ]] + [[ print_data(data) == False or removeParentNode('blockTable') ]] Total: @@ -337,14 +337,14 @@ [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_credit(o.period_id.id, o.journal_id.id) ) ]] - [[ print_data(data) or removeParentNode('blockTable') ]] + [[ print_data(data) or removeParentNode('blockTable') ]] Total: [[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_credit(o.period_id.id, o.journal_id.id) ) ]] - [[ o.journal_id.currency and formatLang(sum_currency_amount_account(o, data['form'])) + o.journal_id.currency.code or '' ]] + @@ -352,7 +352,7 @@
[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]] - [[ print_data(data) == False or removeParentNode('blockTable') ]] + [[ print_data(data) == False or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]] @@ -361,14 +361,14 @@ [[ formatLang(line['debit']-line['credit']) ]] - [[ print_data(data) or removeParentNode('blockTable') ]] + [[ print_data(data) or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]] [[ formatLang(line['debit']) ]] [[ formatLang(line['credit'])]] [[ formatLang(line['debit']-line['credit']) ]] - [[ line['currency_id'] and formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '']] + [[ formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '']]