[FIX] website_sale: do not display unavailable pricelists

It should not be possible via /shop/change_pricelist/<pl_id>
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
This commit is contained in:
Uku Lagle
2017-05-29 12:25:54 +02:00
committed by Thibault Delavallée
parent 8ee9cec4d5
commit 97790089c4
+1 -1
View File
@@ -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):
"""