[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:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user