diff --git a/account_financial_report/report/account_balance.py b/account_financial_report/report/account_balance.py index 82fa5e65..9bab471e 100644 --- a/account_financial_report/report/account_balance.py +++ b/account_financial_report/report/account_balance.py @@ -141,7 +141,7 @@ class account_balance(report_sxw.rml_parse): return rc_obj.browse(self.cr, self.uid, company_id).currency_id.id - def lines(self, form, ids={}, done=None, level=0): + def lines(self, form, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period @@ -155,12 +155,7 @@ class account_balance(report_sxw.rml_parse): self.to_currency_id = form['currency_id'] and form['currency_id'][0] tot_eje = 0.0 - if not ids: - ids = self.ids - if not ids: - return [] - if not done: - done = {} + if form.has_key('account_list') and form['account_list']: account_ids = form['account_list'] del form['account_list'] @@ -172,11 +167,12 @@ class account_balance(report_sxw.rml_parse): fiscalyear_obj = self.pool.get('account.fiscalyear') # Get the fiscal year - fiscalyear = None if form.get('fiscalyear'): - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, form['fiscalyear']) - else: - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear_obj.find(self.cr, self.uid)) + if type(form.get('fiscalyear')) in (list,tuple): + fiscalyear = form['fiscalyear'] and form['fiscalyear'][0] + elif type(form.get('fiscalyear')) in (int,): + fiscalyear = form['fiscalyear'] + fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear) # # Get the accounts @@ -267,11 +263,6 @@ class account_balance(report_sxw.rml_parse): for account in accounts: account_id = account['id'] - if account_id in done: - pass - - done[account_id] = 1 - # # Calculate the account level # diff --git a/account_financial_report/report/account_balance_2_cols.py b/account_financial_report/report/account_balance_2_cols.py index 6f00642f..5fd17377 100644 --- a/account_financial_report/report/account_balance_2_cols.py +++ b/account_financial_report/report/account_balance_2_cols.py @@ -144,7 +144,7 @@ class account_balance(report_sxw.rml_parse): - def lines(self, form, ids={}, done=None, level=0): + def lines(self, form, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period @@ -162,12 +162,6 @@ class account_balance(report_sxw.rml_parse): tot_deb = 0.0 tot_crd = 0.0 tot_eje = 0.0 - if not ids: - ids = self.ids - if not ids: - return [] - if not done: - done = {} if form.has_key('account_list') and form['account_list']: account_ids = form['account_list'] @@ -179,12 +173,12 @@ class account_balance(report_sxw.rml_parse): period_obj = self.pool.get('account.period') fiscalyear_obj = self.pool.get('account.fiscalyear') - fiscalyear = None if form.get('fiscalyear'): - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, form['fiscalyear']) - else: - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear_obj.find(self.cr, self.uid)) - + if type(form.get('fiscalyear')) in (list,tuple): + fiscalyear = form['fiscalyear'] and form['fiscalyear'][0] + elif type(form.get('fiscalyear')) in (int,): + fiscalyear = form['fiscalyear'] + fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear) # # Get the accounts # @@ -290,11 +284,6 @@ class account_balance(report_sxw.rml_parse): for account in accounts: account_id = account['id'] - if account_id in done: - pass - - done[account_id] = 1 - accounts_levels[account_id] = account['level'] # diff --git a/account_financial_report/report/account_balance_4_cols.py b/account_financial_report/report/account_balance_4_cols.py index 781d6fc8..b131d9c2 100644 --- a/account_financial_report/report/account_balance_4_cols.py +++ b/account_financial_report/report/account_balance_4_cols.py @@ -149,7 +149,7 @@ class account_balance(report_sxw.rml_parse): rc_obj = self.pool.get('res.company') return rc_obj.browse(self.cr, self.uid, company_id).currency_id.id - def lines(self, form, ids={}, done=None, level=0): + def lines(self, form, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period @@ -165,12 +165,6 @@ class account_balance(report_sxw.rml_parse): tot_deb = 0.0 tot_crd = 0.0 tot_eje = 0.0 - if not ids: - ids = self.ids - if not ids: - return [] - if not done: - done = {} if form.has_key('account_list') and form['account_list']: account_ids = form['account_list'] @@ -182,11 +176,12 @@ class account_balance(report_sxw.rml_parse): period_obj = self.pool.get('account.period') fiscalyear_obj = self.pool.get('account.fiscalyear') - fiscalyear = None if form.get('fiscalyear'): - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, form['fiscalyear']) - else: - fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear_obj.find(self.cr, self.uid)) + if type(form.get('fiscalyear')) in (list,tuple): + fiscalyear = form['fiscalyear'] and form['fiscalyear'][0] + elif type(form.get('fiscalyear')) in (int,): + fiscalyear = form['fiscalyear'] + fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear) # # Get the accounts @@ -305,11 +300,6 @@ class account_balance(report_sxw.rml_parse): for account in accounts: account_id = account['id'] - if account_id in done: - pass - - done[account_id] = 1 - accounts_levels[account_id] = account['level'] #