[FIX] website_sale: _is_available_on_website access rights issues

- The method `_is_available_on_website` on `product.pricelist` access to
  the field `code` which is limited to the group `base.group_user`.
  This causes issues when the method is called by a non internal user.

closes odoo/odoo#32123

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit is contained in:
Toufik Ben Jaa
2019-03-26 10:15:43 +00:00
parent f00c490be8
commit a3cdfdc628
+1 -1
View File
@@ -79,7 +79,7 @@ class ProductPricelist(models.Model):
Change in this method should be reflected in `_get_website_pricelists_domain`.
"""
self.ensure_one()
return self.website_id.id == website_id or (not self.website_id and (self.selectable or self.code))
return self.website_id.id == website_id or (not self.website_id and (self.selectable or self.sudo().code))
def _get_website_pricelists_domain(self, website_id):
''' Check above `_is_available_on_website` for explanation.