From 97790089c4e52c763b0edb7e4931b8d4f189191c Mon Sep 17 00:00:00 2001 From: Uku Lagle Date: Thu, 25 May 2017 22:17:06 +0300 Subject: [PATCH] [FIX] website_sale: do not display unavailable pricelists It should not be possible via /shop/change_pricelist/ to change to a pricelist that is not marked as selectable. is_pricelist_available method should do that, but is not, because it calls get_pricelist_available with show_visible=True, instead of show_visible=False :param bool show_visible: if True, we don't display pricelist where selectable is False (Eg: Code promo) Closes #17220 --- 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 94edada65ac..28c157dfbfa 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -268,7 +268,7 @@ class Website(models.Model): :param int pl_id: The pricelist id to check :returns: Boolean, True if valid / available """ - return pl_id in self.get_pricelist_available(show_visible=False).ids + return pl_id in self.get_pricelist_available(show_visible=True).ids def get_current_pricelist(self): """