[FIX] sale: _get_tax_amount_by_group
The function _get_tax_amount_by_group must take the discount applied on line when computing the amount of each tax. opw:692560
This commit is contained in:
@@ -508,7 +508,7 @@ class SaleOrder(models.Model):
|
||||
for tax in line.tax_id:
|
||||
group = tax.tax_group_id
|
||||
res.setdefault(group, 0.0)
|
||||
res[group] += tax.compute_all(line.price_unit, quantity=line.product_uom_qty)['taxes'][0]['amount']
|
||||
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)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user