[FIX] website_sale: pricelist multi company

When modifying the company_id of a pricelist, the check to ensure
a website has a pricelist available wasn't triggered.

This commit ensures the check is done in this case, to avoid
the absence of any pricelist for a given website (which breaks /shop).

Fixes #50707

closes odoo/odoo#50760

X-original-commit: 911ada2d02b24778435fd9174441a6834da2effa
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2020-05-06 13:22:11 +00:00
parent a65b17659c
commit e28b9ce4ca
+1 -1
View File
@@ -54,7 +54,7 @@ class ProductPricelist(models.Model):
def write(self, data):
res = super(ProductPricelist, self).write(data)
if data.keys() & {'code', 'active', 'website_id', 'selectable'}:
if data.keys() & {'code', 'active', 'website_id', 'selectable', 'company_id'}:
self._check_website_pricelist()
self.clear_cache()
return res