[FIX] website_sale: don't handle pl promo code if already applied

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) <jke@openerp.com>
This commit is contained in:
Romain Derie
2019-07-10 10:25:20 +00:00
parent 06d149a3b1
commit d24c196397
+1 -1
View File
@@ -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