From 0dcf139aa763b05f0600c7d6e2ccea70be2148ef Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Tue, 14 Nov 2017 14:46:10 +0000 Subject: [PATCH] [FIX] website_sale: missing sudo for website public + portal user Portal user and public user do not have access on account.tax Was already fixed at #19153 but lost in forward port Closes #20802 --- addons/website_sale/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index a93f9d6ce81..133494dc184 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -197,7 +197,7 @@ class Product(models.Model): ret = self.env.user.has_group('sale.group_show_price_subtotal') and 'total_excluded' or 'total_included' for p, p2 in pycompat.izip(self, self2): - taxes = partner.property_account_position_id.map_tax(p.taxes_id.filtered(lambda x: x.company_id == company_id)) + taxes = partner.property_account_position_id.map_tax(p.sudo().taxes_id.filtered(lambda x: x.company_id == company_id)) p.website_price = taxes.compute_all(p2.price, pricelist.currency_id, quantity=qty, product=p2, partner=partner)[ret] price_without_pricelist = taxes.compute_all(p.list_price, pricelist.currency_id)[ret] p.website_price_difference = False if float_is_zero(price_without_pricelist - p.website_price, precision_rounding=pricelist.currency_id.rounding) else True