From 2a07e895861fc509fd31cc30c8a5e789c5d1a8af Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 21 Jul 2010 16:11:22 +0530 Subject: [PATCH] [IMP] account: Improve the general_journal report bzr revid: sbh@tinyerp.com-20100721104122-sqnyy2ow31wjaws6 --- addons/account/report/general_journal.py | 14 +----------- addons/account/report/general_journal.rml | 28 ++--------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py index 265f7ad98c6..9ff93d1d779 100644 --- a/addons/account/report/general_journal.py +++ b/addons/account/report/general_journal.py @@ -48,12 +48,11 @@ class journal_print(report_sxw.rml_parse, common_report_header): 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period, 'get_sortby': self._get_sortby, - 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_filter': self._get_filter, 'get_journal': self._get_journal, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, - 'get_currency ':self._get_currency + 'get_currency':self._get_currency }) def set_context(self, objects, data, ids, report_type=None): # Improve move to common default? @@ -105,17 +104,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/general_journal.rml b/addons/account/report/general_journal.rml index 433639ed084..4b69d09c841 100644 --- a/addons/account/report/general_journal.rml +++ b/addons/account/report/general_journal.rml @@ -4,30 +4,7 @@ - - - - - - - - - - - - [[ company.name ]] - General Journal - [[ company.currency_id.name ]] - - - - [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]] - Page - - - - - 0.88cm 27.7cm 20.12cm 27.7cm - + @@ -322,7 +299,6 @@ [[ formatLang(sum_debit()) ]] [[ formatLang( sum_credit()) ]] [[ formatLang( sum_debit()- sum_credit()) ]] - [[ formatLang(sum_currency_amount_account(o, data)) or '' ]] @@ -357,7 +333,7 @@ [[ formatLang(line['debit'] )]] [[ formatLang(line['credit']) ]] [[ formatLang(line['debit']-line['debit'] ) ]] - [[ formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '' ]] + [[ formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '' ]]