diff options
| author | Goffin Simon <sig@odoo.com> | 2017-07-10 11:40:52 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2017-07-10 14:05:20 +0200 |
| commit | fafdd027fa6407ce2dcff5bd4f1fc5632c9d081d (patch) | |
| tree | 154dd26b4bbf066792c0944d3c5df94df945eb06 | |
| parent | 57089bbc78a3121534a9fab6482a34c06b786ddf (diff) | |
[FIX] sale: Wrong taxes amount printed in SO
Steps to reproduce the bug:
-Create a tax group TX with two taxes: 15% and 5%
-Create a SO with one line and set TX on it
-Print the SO
Bug:
Only the first tax of TX was taking into account
opw:748923
| -rw-r--r-- | addons/sale/models/sale.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 534a4cd58e6..867028ff223 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -510,9 +510,10 @@ class SaleOrder(models.Model): for tax in line.tax_id: group = tax.tax_group_id res.setdefault(group, 0.0) - amount = tax.compute_all(line.price_reduce + base_tax, quantity=line.product_uom_qty, - product=line.product_id, partner=self.partner_shipping_id)['taxes'][0]['amount'] - res[group] += amount + taxes = tax.compute_all(line.price_reduce + base_tax, quantity=line.product_uom_qty, + product=line.product_id, partner=self.partner_shipping_id)['taxes'] + for t in taxes: + res[group] += t['amount'] if tax.include_base_amount: base_tax += tax.compute_all(line.price_reduce + base_tax, quantity=1, product=line.product_id, partner=self.partner_shipping_id)['taxes'][0]['amount'] |
