From 6356a0904162f5a7f3de1add0cd3e366b05e734c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 21 May 2019 13:04:50 +0000 Subject: [PATCH] [FIX] website_quote: pricelist and template - Create a product, sale price of 100 - Create a quotation template Product A: 10 Units - Create a pricelist Product A: 10% discount for a quantity of 10 - Create a SO - Set the pricelist - Set the quotation template The unit price is 100 instead of 90. This is because we retrieve the price based on a quantity of 1 instead on the quantity specified in the template. opw-1998642 closes odoo/odoo#33534 Signed-off-by: Nicolas Martinelli (nim) --- addons/website_quote/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_quote/models/sale_order.py b/addons/website_quote/models/sale_order.py index f2777afadba..8d8931cd01c 100644 --- a/addons/website_quote/models/sale_order.py +++ b/addons/website_quote/models/sale_order.py @@ -119,7 +119,7 @@ class SaleOrder(models.Model): for line in template.quote_line: discount = 0 if self.pricelist_id: - price = self.pricelist_id.with_context(uom=line.product_uom_id.id).get_product_price(line.product_id, 1, False) + price = self.pricelist_id.with_context(uom=line.product_uom_id.id).get_product_price(line.product_id, line.product_uom_qty, False) if self.pricelist_id.discount_policy == 'without_discount' and line.price_unit: discount = (line.price_unit - price) / line.price_unit * 100 price = line.price_unit