From 9fdbbb816cfd6b8a81ab807244033d16de78107d Mon Sep 17 00:00:00 2001 From: len-odoo Date: Wed, 7 Mar 2018 12:01:34 +0100 Subject: [PATCH] [FIX] website_sale: display prices using public user pricelist on the shop When a pricelist was set on the public user that was different from that of the website, the prices were displayed using the public user default currency, but the currency symbol displayed was the website default currency. The issue was that in the template, the currency was accessed as a computed, related field of website while the price was obtained using a function call. In the first case the field was obtained using sudo, and thus the call would not get the public user pricelist. opw-1817761 --- addons/website_sale/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py index 5de0f524fc7..9f43a6791d8 100644 --- a/addons/website_sale/models/website.py +++ b/addons/website_sale/models/website.py @@ -14,7 +14,7 @@ class Website(models.Model): _inherit = 'website' pricelist_id = fields.Many2one('product.pricelist', compute='_compute_pricelist_id', string='Default Pricelist') - currency_id = fields.Many2one('res.currency', related='pricelist_id.currency_id', string='Default Currency') + currency_id = fields.Many2one('res.currency', related='pricelist_id.currency_id', related_sudo=False, string='Default Currency') salesperson_id = fields.Many2one('res.users', string='Salesperson') salesteam_id = fields.Many2one('crm.team', string='Sales Channel') pricelist_ids = fields.One2many('product.pricelist', compute="_compute_pricelist_ids",