From bbb3bd876a337d35f75c06ff53bbb5284c830f76 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 30 Mar 2017 13:43:33 +0200 Subject: [PATCH] [FIX] account_extra_reports: Partner Ledger report - Activate multi-currency - Create an invoice in a currency different from the company currency - Go to Accounting > Reporting > Management > Partner Ledger - Activate the option "With Currency" The report printed doesn't contain the amount currency. opw-726440 --- .../report/account_partner_ledger.py | 2 ++ .../account_extra_reports/views/report_partnerledger.xml | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/account_extra_reports/report/account_partner_ledger.py b/addons/account_extra_reports/report/account_partner_ledger.py index 53b9164f032..9d72a4c1b3f 100644 --- a/addons/account_extra_reports/report/account_partner_ledger.py +++ b/addons/account_extra_reports/report/account_partner_ledger.py @@ -11,6 +11,7 @@ class ReportPartnerLedger(models.AbstractModel): def _lines(self, data, partner): full_account = [] + currency = self.env['res.currency'] query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".reconciled = false ' params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] @@ -40,6 +41,7 @@ class ReportPartnerLedger(models.AbstractModel): ) sum += r['debit'] - r['credit'] r['progress'] = sum + r['currency_id'] = currency.browse(r.get('currency_id')) full_account.append(r) return full_account diff --git a/addons/account_extra_reports/views/report_partnerledger.xml b/addons/account_extra_reports/views/report_partnerledger.xml index e8cb8c3e263..e200d0f08a8 100644 --- a/addons/account_extra_reports/views/report_partnerledger.xml +++ b/addons/account_extra_reports/views/report_partnerledger.xml @@ -36,7 +36,7 @@ Debit Credit Balance - Currency + Currency @@ -77,8 +77,10 @@ - - + + + +