[FIX] web_favicon: Ensure web favicon is displayed on the website

This commit is contained in:
Rocío Vega
2024-07-04 11:25:55 -03:00
committed by Franco Leyes
parent 1e9f88080e
commit 5bf9de3b2d
2 changed files with 29 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ class ResCompany(models.Model):
@api.model
def _get_favicon(self):
"""Returns a local url that points to the image field of a given record."""
if self.env.context.get("website_id"):
website = self.env["website"].browse(self.env.context.get("website_id"))
return website.image_url(website, "favicon")
company_id = (
request.httprequest.cookies.get("cids")
if request.httprequest.cookies.get("cids")