From 701a010bb1f249982a3683c8ce5c1f0e32c5d555 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 21 Oct 2010 11:03:51 +0530 Subject: [PATCH] [REM] Account: Tax report removed unused methods bzr revid: mra@mra-laptop-20101021053351-fbesnyy6706s5wzn --- addons/account/report/account_tax_report.py | 26 ++++++--------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/addons/account/report/account_tax_report.py b/addons/account/report/account_tax_report.py index 49a11096789..45ba56bf446 100644 --- a/addons/account/report/account_tax_report.py +++ b/addons/account/report/account_tax_report.py @@ -31,10 +31,8 @@ class tax_report(rml_parse.rml_parse): super(tax_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, - 'get_period': self._get_period, 'get_codes': self._get_codes, 'get_general': self._get_general, - 'get_company': self._get_company, 'get_currency': self._get_currency, 'get_lines': self._get_lines, 'get_years': self.get_years, @@ -66,7 +64,6 @@ class tax_report(rml_parse.rml_parse): def _get_lines(self, based_on, company_id=False, parent=False, level=0, context=None): period_list = self.period_ids res = self._get_codes(based_on, company_id, parent, level, period_list, context=context) - if period_list: res = self._add_codes(based_on, res, period_list, context=context) else: @@ -104,11 +101,8 @@ class tax_report(rml_parse.rml_parse): i+=1 return top_result - def _get_period(self, period_id, context={}): - return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name - - def _get_general(self, tax_code_id, period_list, company_id, based_on, context={}): - res=[] + def _get_general(self, tax_code_id, period_list, company_id, based_on, context=None): + res = [] obj_account = self.pool.get('account.account') periods_ids = tuple(period_list) if based_on == 'payments': @@ -161,7 +155,7 @@ class tax_report(rml_parse.rml_parse): i+=1 return res - def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context={}): + def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context=None): obj_tc = self.pool.get('account.tax.code') ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], context=context) @@ -172,7 +166,7 @@ class tax_report(rml_parse.rml_parse): res += self._get_codes(based_on, company_id, code.id, level+1, context=context) return res - def _add_codes(self, based_on, account_list=[], period_list=[], context={}): + def _add_codes(self, based_on, account_list=[], period_list=[], context=None): res = [] obj_tc = self.pool.get('account.tax.code') for account in account_list: @@ -187,16 +181,10 @@ class tax_report(rml_parse.rml_parse): res.append((account[0], code)) return res + def _get_currency(self, form, context=None): + return self.pool.get('res.company').browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name - def _get_company(self, form, context={}): - obj_company = self.pool.get('res.company') - return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).name - - def _get_currency(self, form, context={}): - obj_company = self.pool.get('res.company') - return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name - - def sort_result(self, accounts, context={}): + def sort_result(self, accounts, context=None): # On boucle sur notre rapport result_accounts = [] ind=0