From fafdd027fa6407ce2dcff5bd4f1fc5632c9d081d Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 10 Jul 2017 11:40:52 +0200 Subject: [PATCH] [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 --- addons/sale/models/sale.py | 7 ++++--- 1 file 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']