From 3aae56582ab8c219fc1567e137b6a4cee07aaf78 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 1 Jul 2015 11:01:52 +0200 Subject: [PATCH] [FIX] account: general ledger & trial balance report from accounts list When printing these reports from the accounts list Accounting > Configuration > Accounts > Print menu > General Ledger the ID of the wizard was considered as the ID of an account, leading to obvious issues when this ID wasn't available in the account_account table, or when the user do not had the access rights to see the accounts with this ID. The override was completely useless: The wizard is launched whether you print these reports from Accounting > Reporting > Legal reports > Accounting Reports or from the accounts list, and the super _get_account can be called correctly for these two use cases. opw-643589 --- addons/account/report/account_balance.py | 5 ----- addons/account/report/account_general_ledger.py | 5 ----- 2 files changed, 10 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index af2c37fc610..4bed4619adf 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -60,11 +60,6 @@ class account_balance(report_sxw.rml_parse, common_report_header): objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) return super(account_balance, self).set_context(objects, data, new_ids, report_type=report_type) - def _get_account(self, data): - if data['model']=='account.account': - return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name - return super(account_balance ,self)._get_account(data) - def lines(self, form, ids=None, done=None): def _process_child(accounts, disp_acc, parent): account_rec = [acct for acct in accounts if acct['id']==parent][0] diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index ffccbec300d..0a0529ea854 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -294,11 +294,6 @@ class general_ledger(report_sxw.rml_parse, common_report_header): sum_balance += self.cr.fetchone()[0] or 0.0 return sum_balance - def _get_account(self, data): - if data['model'] == 'account.account': - return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name - return super(general_ledger ,self)._get_account(data) - def _get_sortby(self, data): if self.sortby == 'sort_date': return self._translate('Date')