From 11d9e19f3c172034f381dbd85dc47bddc5ca5c59 Mon Sep 17 00:00:00 2001 From: pso Date: Wed, 24 Nov 2010 14:00:29 +0530 Subject: [PATCH] [IMP] account: Improved partner ledger report for currency bzr revid: pso@tinyerp.com-20101124083029-kn69p6roavd6786c --- addons/account/report/account_partner_ledger.py | 5 +++++ addons/account/report/account_partner_ledger_other.rml | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 01b46ae70bc..9958058bf7c 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -51,6 +51,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): 'display_initial_balance':self._display_initial_balance, 'display_currency':self._display_currency, 'get_target_move': self._get_target_move, + 'get_currency': self._get_currency, 'sum_currency_amount_account': self._sum_currency_amount_account }) @@ -162,6 +163,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): full_account.append(r) return full_account + def _get_currency(self): + self.cr.execute("select distinct currency_id from account_invoice") + return self.cr.fetchall() + def _get_intial_balance(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml index 36aadc9e0dc..be217dd3312 100644 --- a/addons/account/report/account_partner_ledger_other.rml +++ b/addons/account/report/account_partner_ledger_other.rml @@ -638,9 +638,7 @@ [[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]] - - - + [[ p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]] @@ -657,7 +655,7 @@ [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]] - [[ p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]] + [[ len(get_currency())==1 and p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]] @@ -690,7 +688,7 @@ [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]] - [[ (p.property_account_receivable.currency_id and formatLang(line['amount_currency'])) or removeParentNode('font') ]] [[ line['currency_code'] or '']] + [[ (len(get_currency())==1 and p.property_account_receivable.currency_id and formatLang(line['amount_currency'])) or removeParentNode('font') ]] [[ line['currency_code'] or '']]