[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 <edm@odoo.com>
This commit is contained in:
Demesmaeker
2023-06-06 11:45:25 +02:00
parent f40ab7c811
commit 623e20e181
+3 -3
View File
@@ -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')