[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) <nim@odoo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user