From 8a7426da753da0fbc580c8f52d298a4c168dbf45 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 15 Nov 2017 10:48:14 +0100 Subject: [PATCH] [FIX] account: tax amount on invoice document - Install French language - Set language of Customer A to French - Create an invoice for A (some tax must be applied) - Print the invoice The tax amount below 'Subtotal' is not formatted in French. `t-esc` does make use of the `t-lang` option, so when the expression is evaluated, the lang is not in the context. We do not change this behavior since it can have a major impact. opw-782118 --- addons/account/models/account_invoice.py | 4 +++- addons/account/views/report_invoice.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index e3150abb86f..967bcc485c5 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1159,7 +1159,9 @@ class AccountInvoice(models.Model): res.setdefault(line.tax_id.tax_group_id, 0.0) res[line.tax_id.tax_group_id] += line.amount res = sorted(res.items(), key=lambda l: l[0].sequence) - res = map(lambda l: (l[0].name, l[1]), res) + res = [( + r[0].name, r[1], formatLang(self.with_context(lang=self.partner_id.lang).env, r[1], currency_obj=currency) + ) for r in res] return res diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 9fa3bf77c8c..bc1288654dc 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -104,7 +104,7 @@ - +