From bf28576c4f79863b7005fbefe2d7117107206d2e Mon Sep 17 00:00:00 2001 From: sergio-teruel Date: Wed, 29 Apr 2026 12:15:57 +0200 Subject: [PATCH] [IMP] product_pricelist_supplierinfo: Compute price with sudo for e-commerce environment with no logged users --- product_pricelist_supplierinfo/models/product_product.py | 3 ++- product_pricelist_supplierinfo/models/product_template.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/product_pricelist_supplierinfo/models/product_product.py b/product_pricelist_supplierinfo/models/product_product.py index c641aa32ea3..9e244a1f694 100644 --- a/product_pricelist_supplierinfo/models/product_product.py +++ b/product_pricelist_supplierinfo/models/product_product.py @@ -34,7 +34,8 @@ def _price_compute( self.env.context.get("supplierinfo_rule") ) for product in self: - prices[product.id] = product._get_supplierinfo_pricelist_price( + # Use sudo due to avoid access error to public user in e-commerce + prices[product.id] = product.sudo()._get_supplierinfo_pricelist_price( rule, date=date or self.env.context.get("date", fields.Date.today()), quantity=self.env.context.get("supplierinfo_quantity", 1), diff --git a/product_pricelist_supplierinfo/models/product_template.py b/product_pricelist_supplierinfo/models/product_template.py index d8f32883fb6..3c1032aa711 100644 --- a/product_pricelist_supplierinfo/models/product_template.py +++ b/product_pricelist_supplierinfo/models/product_template.py @@ -71,7 +71,8 @@ def _price_compute( self.env.context.get("supplierinfo_rule") ) for product in self: - prices[product.id] = product._get_supplierinfo_pricelist_price( + # Use sudo due to avoid access error to public user in e-commerce + prices[product.id] = product.sudo()._get_supplierinfo_pricelist_price( rule, date=date or self.env.context.get("date", fields.Date.today()), quantity=self.env.context.get("supplierinfo_quantity", 1),