From 0885fdb9e663fc1b3ae7510e239ba8c404aea9d5 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 25 Aug 2011 02:45:35 +0200 Subject: [PATCH] [IMP] account: added comparison logic to low level report bzr revid: qdp-launchpad@openerp.com-20110825004535-6lfhbsal2dygpqb0 --- .../report/account_low_level_report.py | 4 ++++ .../report/account_low_level_report.rml | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/addons/account/report/account_low_level_report.py b/addons/account/report/account_low_level_report.py index 10e5efaea7d..ddcb2022198 100644 --- a/addons/account/report/account_low_level_report.py +++ b/addons/account/report/account_low_level_report.py @@ -101,6 +101,8 @@ class report_account_common(report_sxw.rml_parse, common_report_header): 'balance': report.balance, 'type': 'report', } + if data['form']['enable_filter']: + vals['balance_cmp'] = self.pool.get('account.low.level.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance lines.append(vals) if report.type == 'accounts' and report.display_detail: for account in report.account_ids: @@ -109,6 +111,8 @@ class report_account_common(report_sxw.rml_parse, common_report_header): 'balance': account.balance, 'type': 'account', } + if data['form']['enable_filter']: + vals['balance_cmp'] = self.pool.get('account.account').browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance lines.append(vals) return lines diff --git a/addons/account/report/account_low_level_report.rml b/addons/account/report/account_low_level_report.rml index 5b5599adccb..4cd0d564839 100644 --- a/addons/account/report/account_low_level_report.rml +++ b/addons/account/report/account_low_level_report.rml @@ -232,6 +232,7 @@ Accounts + [[data['form']['enable_filter'] == False or removeParentNote('blockTable')]] Name @@ -257,6 +258,26 @@ --> + + [[data['form']['enable_filter'] == True or removeParentNote('blockTable')]] + + + Name + + + Balance + + + [[data['form']['label_filter']]] + + + + [[ repeatIn(get_lines(data), 'a') ]] + [[a.get('name', '')]] + [[a.get('balance',0.0)]] + [[a.get('balance_cmp',0.0)]] + +