[IMP] sale,account: currency formatting with taxes on reports
Uses the widget monetary to display the tax amounts the same way as the other amounts on the views. Closes #14282
This commit is contained in:
@@ -1118,7 +1118,7 @@ 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, formatLang(self.env, l[1], currency_obj=currency)), res)
|
||||
res = map(lambda l: (l[0].name, l[1]), res)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<tr>
|
||||
<td><span t-esc="amount_by_group[0]"/></td>
|
||||
<td class="text-right">
|
||||
<span t-esc="amount_by_group[1]"/>
|
||||
<span t-esc="amount_by_group[1]" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
@@ -497,7 +497,7 @@ class SaleOrder(models.Model):
|
||||
res.setdefault(group, 0.0)
|
||||
res[group] += tax.compute_all(line.price_reduce, quantity=line.product_uom_qty)['taxes'][0]['amount']
|
||||
res = sorted(res.items(), key=lambda l: l[0].sequence)
|
||||
res = map(lambda l: (l[0].name, formatLang(self.env, l[1], currency_obj=currency)), res)
|
||||
res = map(lambda l: (l[0].name, l[1]), res)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@
|
||||
<tr>
|
||||
<td><span t-esc="amount_by_group[0] or 'Taxes'"/></td>
|
||||
<td class="text-right">
|
||||
<span t-esc="amount_by_group[1]"/>
|
||||
<span t-esc="amount_by_group[1]"
|
||||
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user