From 623e20e181eaf0ff037635ade17e1ce9c692a13d Mon Sep 17 00:00:00 2001 From: Demesmaeker Date: Wed, 31 May 2023 15:04:04 +0000 Subject: [PATCH] [FIX] website_sale: show correct terms and conditions from company Currently, on a multi-company environment with different website domains set, the terms and conditions web page, which should be company-specific, are not correctly "pulled" if you check a SO This was due to the website override that searched for a current_website, even if none was set on a SO, thus setting the website url instead of the company one. opw-3239061 closes odoo/odoo#123855 X-original-commit: ac5c042d3b1e0774ad430a66142437fc8db2fded Signed-off-by: Morgane Demesmaeker --- addons/website_sale/models/sale_order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 90d627b2d46..4bcf08dfa3e 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -61,9 +61,9 @@ class SaleOrder(models.Model): @api.model def _get_note_url(self): - website = self.env['website'].get_current_website() - if website: - return website.get_base_url() + website_id = self._context.get('website_id') + if website_id: + return self.env['website'].browse(website_id).get_base_url() return super()._get_note_url() @api.depends('order_line')