From 61ad8a9ea70671bf5059c65aa3aae10b8ae1ce71 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 27 Aug 2019 08:24:10 +0000 Subject: [PATCH] [FIX] website_event_sale: event discount Fine-tuning 180866fe1e3b8998cc47ee584abaaff76d4135bb - Go to Sales > Configuration > Settings - Enable "Multiple Sales Prices per Product" and select option "Prices computed from formulas (discounts, margins, roundings)" - Go to Sales > Catalog / Pricelists - Select "Public Pricelist" and set "Discount Policy: Show public price & discount to the customer" - Add a discount to an event (20 % to "Open Days in Los Angeles" for example) - Go to the eCommerce, buy a ticket to "Open Days in Los Angeles" which as a 20 % discount Since 180866fe1e3b8998cc47ee584abaaff76d4135bb the discount is applied two times. opw-2058709 closes odoo/odoo#36106 Signed-off-by: Nicolas Martinelli (nim) --- addons/website_event_sale/models/sale_order.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py index 58c56bc9441..05e81f2605b 100644 --- a/addons/website_event_sale/models/sale_order.py +++ b/addons/website_event_sale/models/sale_order.py @@ -41,7 +41,10 @@ class SaleOrder(models.Model): values['product_id'] = ticket.product_id.id values['event_id'] = ticket.event_id.id values['event_ticket_id'] = ticket.id - values['price_unit'] = ticket.price_reduce + if order.pricelist_id.discount_policy == 'without_discount': + values['price_unit'] = ticket.price + else: + values['price_unit'] = ticket.price_reduce values['name'] = "%s\n%s" % (ticket.event_id.display_name, ticket.name) # avoid writing related values that end up locking the product record