From d24c1963972d4efc78d510512ccbe74ef5eac5f4 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 10 Jul 2019 09:34:20 +0000 Subject: [PATCH] [FIX] website_sale: don't handle pl promo code if already applied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a pl promo code is applied, the code is shown in the promo code input. Before this commit, if the user clicked on "Apply" (so with the same code) it would remove the pl as it would go in the `if` condition that is supposed to handle empty code modo to reset pl. Coming from #34633 closes odoo/odoo#34734 Signed-off-by: Jérémy Kersten (jke) --- addons/website_sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 97e6a09a7a5..b56d7e24702 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -456,7 +456,7 @@ class Website(models.Model): if code_pricelist: pricelist_id = code_pricelist.id update_pricelist = True - elif code is not None and sale_order.pricelist_id.code: + elif code is not None and sale_order.pricelist_id.code and code != sale_order.pricelist_id.code: # code is not None when user removes code and click on "Apply" pricelist_id = partner.property_product_pricelist.id update_pricelist = True