[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:
committed by
Martin Trigaux
parent
dde554726b
commit
0dcf139aa7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user