[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
This commit is contained in:
Wolfgang Taferner
2017-11-14 15:46:10 +01:00
committed by Martin Trigaux
parent dde554726b
commit 0dcf139aa7
+1 -1
View File
@@ -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