From 428588a8b730f7d65a4064eee84d27675356b41f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 10 Sep 2015 14:58:18 +0200 Subject: [PATCH] [FIX] website_quote: Amount before discount with included taxes The undiscounted amount did not take into account the taxes included in the price. Included taxes were seen as a discount. For a quotation with one line with an included tax of 15%, but no discount, the undiscounted amount must be the line price subtotal, the price subtotal already removing the taxes from the price unit. For a quotation with one line with an included tax of 15%, and a discount of 10%, the undiscounted amount must be the line price subtotal, plus the amount discounted. That way, the taxes included are already removed from the price, but the discount is not included. opw-648388 --- addons/website_quote/models/order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py index 0384918c35a..ff8fa7bf672 100644 --- a/addons/website_quote/models/order.py +++ b/addons/website_quote/models/order.py @@ -132,7 +132,7 @@ class sale_order(osv.osv): for order in self.browse(cr, uid, ids, context=context): total = 0.0 for line in order.order_line: - total += (line.product_uom_qty * line.price_unit) + total += line.price_subtotal + line.price_unit * ((line.discount or 0.0) / 100.0) * line.product_uom_qty res[order.id] = total return res