[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
This commit is contained in:
Nicolas Martinelli
2017-11-15 12:57:19 +01:00
parent a9beee42d6
commit 8a7426da75
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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
+1 -1
View File
@@ -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>