From 129aa858832af14c853287d050c8bf5b55bd849c Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 30 Jul 2010 12:38:22 +0530 Subject: [PATCH] [IMP] account: Remove the chart_account from object and set the company_id bzr revid: sbh@tinyerp.com-20100730070822-22xs52u8ep1ljzqo --- addons/account/report/account_balance.py | 6 +++++- addons/account/report/account_balance.rml | 5 ++--- addons/account/report/general_ledger.py | 4 ++++ addons/account/report/general_ledger_landscape.rml | 8 ++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index e93eb92160c..4c192a6f04d 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -61,7 +61,11 @@ class account_balance(report_sxw.rml_parse, common_report_header): if header == 0: self.rml_header = "" return True - + 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=[], done=None, level=1): obj_account = self.pool.get('account.account') if not ids: diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index e461ae8fe98..faaa13adb47 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -211,9 +211,8 @@ - - Chart of Account - + Company [[ data['model']=='account.account' or removeParentNode('para') ]] + Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] Fiscal Year diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 1e5343d8930..25b049019ba 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -230,6 +230,10 @@ class general_ledger(rml_parse.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': diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml index 3095b316d31..2ca1209ce58 100644 --- a/addons/account/report/general_ledger_landscape.rml +++ b/addons/account/report/general_ledger_landscape.rml @@ -5,8 +5,7 @@ - - + @@ -177,7 +176,7 @@ - + @@ -207,7 +206,8 @@ - Chat Account + Company [[ data['model']=='account.account' or removeParentNode('para') ]] + Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] Fiscal Year Journals Display Account