[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:
Goffin Simon
2016-11-07 09:42:07 +01:00
parent f764a76d2e
commit 99743cc4aa
+1 -1
View File
@@ -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