From d33a109f3ac72216fb1ef588dd0d858fab01ee3e Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Tue, 27 Jul 2010 17:44:48 +0530 Subject: [PATCH] [Fix] account: Remove the sum_currency_amount_account bzr revid: sbh@tinyerp.com-20100727121448-js956e6sc90gyy6g --- addons/account/report/general_ledger.py | 14 -------------- addons/account/report/report_bs.py | 12 ------------ addons/account/report/report_pl.py | 2 -- addons/account/report/third_party_ledger.py | 5 ++--- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 95fee14f434..10baccc68a3 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -61,7 +61,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header): 'sum_credit_account': self._sum_credit_account, 'sum_balance_account': self._sum_balance_account, 'get_children_accounts': self.get_children_accounts, - 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_fiscalyear': self._get_fiscalyear, 'get_journal': self._get_journal, 'get_account': self._get_account, @@ -215,19 +214,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header): sum_balance += self.cr.fetchone()[0] or 0.0 return sum_balance - def _sum_currency_amount_account(self, account, form): - #FIXME: not working - self.cr.execute("SELECT sum(l.amount_currency) as tot_currency "\ - "FROM account_move_line l "\ - "WHERE l.account_id = %s AND %s"%(account.id, self.query)) - sum_currency = self.cr.fetchone()[0] or 0.0 - if form.get('initial_balance', False): - self.cr.execute("SELECT sum(l.amount_currency) as tot_currency "\ - "FROM account_move_line l "\ - "WHERE l.account_id = %s AND %s "%(account.id, form['initial_bal_query'])) - # Add initial balance to the result - sum_currency += self.cr.fetchone()[0] or 0.0 - return str(sum_currency) def _get_sortby(self, data): if self.sortby == 'sort_date': diff --git a/addons/account/report/report_bs.py b/addons/account/report/report_bs.py index a91ff9e214b..53aea1411ab 100644 --- a/addons/account/report/report_bs.py +++ b/addons/account/report/report_bs.py @@ -52,7 +52,6 @@ class report_balancesheet_horizontal(rml_parse.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, @@ -64,17 +63,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): def get_abs(self,amount): return abs(amount) - 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 sum_dr(self): if self.res_pl['type'] == 'Net Profit': self.result_sum_dr += self.res_pl['balance'] diff --git a/addons/account/report/report_pl.py b/addons/account/report/report_pl.py index 839fd499e54..f5c84e745b4 100644 --- a/addons/account/report/report_pl.py +++ b/addons/account/report/report_pl.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -51,7 +50,6 @@ class report_pl_account_horizontal(rml_parse.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, diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index 83e11218586..aa3cf64631a 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -49,7 +49,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): 'get_filter': self._get_filter, 'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date, - 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_fiscalyear': self._get_fiscalyear, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, @@ -435,10 +434,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner', 'addons/account/report/third_party_ledger.rml',parser=third_party_ledger, - header=False) + header='internal') report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner', 'addons/account/report/third_party_ledger_other.rml',parser=third_party_ledger, - header=False) + header='internal') # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: