[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:
invitu
2016-12-19 11:53:35 +01:00
committed by Martin Trigaux
parent 4fb380c107
commit f47b3543ee
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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>