diff options
| author | Wolfgang Taferner <wtaferner@users.noreply.github.com> | 2017-11-14 14:46:10 +0000 |
|---|---|---|
| committer | Martin Trigaux <mart-e@users.noreply.github.com> | 2017-11-14 15:46:10 +0100 |
| commit | 0dcf139aa763b05f0600c7d6e2ccea70be2148ef (patch) | |
| tree | 67fb1a3f18ab3d8619f105618c78ca39c3c2aa3d | |
| parent | dde554726b301e42aaa297f899e6fcb83d9e9e63 (diff) | |
[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
| -rw-r--r-- | addons/website_sale/models/product.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
