From 50dc3a24a1b025a6ada99109c2eedb9be1cb5b80 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 16 Jul 2010 15:50:53 +0530 Subject: [PATCH] [IMP] account: Improve the general_ledger_landscape report bzr revid: sbh@tinyerp.com-20100716102053-a9m4thuhj553n4zh --- addons/account/report/general_ledger.py | 8 ++++++-- addons/account/report/general_ledger_landscape.rml | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index ec8c16b1ca9..eb6868b8ed3 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -64,6 +64,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header): 'get_children_accounts': self.get_children_accounts, 'sum_currency_amount_account': self._sum_currency_amount_account, 'get_fiscalyear': self._get_fiscalyear, + 'get_journal': self._get_journal, 'get_account': self._get_account, 'get_start_period': self.get_start_period, 'get_end_period': self.get_end_period, @@ -97,7 +98,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header): if not len(res): return [account] return res - + def lines(self, account, form): """ Return all the account_move_line of account with their account code counterparts """ # First compute all counterpart strings for every move_id where this account appear. @@ -229,7 +230,10 @@ class general_ledger(rml_parse.rml_parse, common_report_header): # Add initial balance to the result sum_currency += self.cr.fetchone()[0] or 0.0 return str(sum_currency) - + def _get_journal(self, journal_ids): + self.cr.execute('select code from account_journal where id IN %s',(tuple(journal_ids),)) + codes = [x for x, in self.cr.fetchall()] + return codes or '' report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header='internal') report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger, header='internal') diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml index 473fc2925f0..4d71bd6f237 100644 --- a/addons/account/report/general_ledger_landscape.rml +++ b/addons/account/report/general_ledger_landscape.rml @@ -182,6 +182,7 @@ + @@ -228,7 +229,7 @@ - + Chat Account Fiscal Year @@ -241,8 +242,9 @@ [[ get_account(data) or removeParentNode('para') ]] [[ get_fiscalyear(data) or removeParentNode('para') ]] - [[ ]] + [[', '.join([ lt or '' for lt in get_journal(data['form']['journal_ids']) ]) ]] [[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_mouvement' and 'With movements') or 'With balance is not equal to 0']] + [[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]