diff --git a/account_financial_report/report/account_balance.py b/account_financial_report/report/account_balance.py index 9bab471e..e4ea9741 100644 --- a/account_financial_report/report/account_balance.py +++ b/account_financial_report/report/account_balance.py @@ -123,11 +123,11 @@ class account_balance(report_sxw.rml_parse): return {'periods':periods_str, 'date':dates_str} def exchange_name(self, form): - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] return self.pool.get('res.currency').browse(self.cr, self.uid, self.to_currency_id).name def exchange(self, from_amount): @@ -148,11 +148,11 @@ class account_balance(report_sxw.rml_parse): and the full year) """ - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] tot_eje = 0.0 diff --git a/account_financial_report/report/account_balance_2_cols.py b/account_financial_report/report/account_balance_2_cols.py index 5fd17377..5e2f29ba 100644 --- a/account_financial_report/report/account_balance_2_cols.py +++ b/account_financial_report/report/account_balance_2_cols.py @@ -125,11 +125,11 @@ class account_balance(report_sxw.rml_parse): def exchange_name(self, form): - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] return self.pool.get('res.currency').browse(self.cr, self.uid, self.to_currency_id).name def exchange(self, from_amount): @@ -152,11 +152,11 @@ class account_balance(report_sxw.rml_parse): """ - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] tot_bin = 0.0 tot_deb = 0.0 diff --git a/account_financial_report/report/account_balance_4_cols.py b/account_financial_report/report/account_balance_4_cols.py index b131d9c2..3e72dfa9 100644 --- a/account_financial_report/report/account_balance_4_cols.py +++ b/account_financial_report/report/account_balance_4_cols.py @@ -132,11 +132,12 @@ class account_balance(report_sxw.rml_parse): return False def exchange_name(self, form): - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] + name = self.pool.get('res.currency').browse(self.cr, self.uid, self.to_currency_id).name return self.pool.get('res.currency').browse(self.cr, self.uid, self.to_currency_id).name def exchange(self, from_amount): @@ -155,11 +156,11 @@ class account_balance(report_sxw.rml_parse): (account info plus debit/credit/balance in the selected period and the full year) """ - self.from_currency_id = self.get_company_currency(form['company_id'] and form['company_id'][0]) + self.from_currency_id = self.get_company_currency(form['company_id'] and type(form['company_id']) in (list,tuple) and form['company_id'][0] or form['company_id']) if not form['currency_id']: self.to_currency_id = self.from_currency_id else: - self.to_currency_id = form['currency_id'] and form['currency_id'][0] + self.to_currency_id = form['currency_id'] and type(form['currency_id']) in (list, tuple) and form['currency_id'][0] or form['currency_id'] tot_bin = 0.0 tot_deb = 0.0