diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-11-15 10:48:14 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-11-15 12:57:19 +0100 |
| commit | 8a7426da753da0fbc580c8f52d298a4c168dbf45 (patch) | |
| tree | 86f18e630b8bdfa322ef52629ad6346baf2c76a9 /addons | |
| parent | a9beee42d652de63edb0b2153b3028447e4eff03 (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_invoice.py | 4 | ||||
| -rw-r--r-- | 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 @@ <tr> <td><span t-esc="amount_by_group[0] if len(o.tax_line_ids) > 1 else (o.tax_line_ids.tax_id.description or o.tax_line_ids.tax_id.name)"/></td> <td class="text-right"> - <span t-esc="amount_by_group[1]" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> + <span t-esc="amount_by_group[2]"/> </td> </tr> </t> |
