[FIX] sale: _get_tax_amount_by_group

When computing the amount tax by group, the taxes which affect base of
subsequent taxes must be taken into account and added to the base amount for
only one product.

opw:703524
This commit is contained in:
Goffin Simon
2017-01-24 15:39:09 +01:00
parent 81808d1459
commit 28b8b9ac37
+1 -1
View File
@@ -505,7 +505,7 @@ class SaleOrder(models.Model):
amount = tax.compute_all(line.price_reduce + base_tax, quantity=line.product_uom_qty)['taxes'][0]['amount']
res[group] += amount
if tax.include_base_amount:
base_tax += amount
base_tax += tax.compute_all(line.price_reduce + base_tax, quantity=1)['taxes'][0]['amount']
res = sorted(res.items(), key=lambda l: l[0].sequence)
res = map(lambda l: (l[0].name, l[1]), res)
return res