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 '']]