From 0c5841dccf6d8afa266e1181364c410222acc140 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Thu, 8 Mar 2018 08:40:46 +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. Equivalent to #23519 for odoo 11.0 opw-1819230 --- addons/website_sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 83189c95c9b..1c757098a32 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -193,7 +193,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 Team') pricelist_ids = fields.One2many('product.pricelist', compute="_compute_pricelist_ids",