Skip to content
Snippets Groups Projects
Commit fa2cc58e authored by Nasreddin Boulif (bon)'s avatar Nasreddin Boulif (bon)
Browse files

[FIX] web: display correct favicon depending company

Steps to reproduce:

 - Activate Debug mode
 - Go to Settings -> Companies
 - Create company A and B and set a different favicon for each company
 - Refresh the page or switch company

Issue:

  The favicon is not the right one.

Cause:

  Code (that update favicon) removed when refractoring of owl.
  Related commit: https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431



Solution:

  When web client start, update in JS the favicons (desktop and mobiles)
  with current company favicon.

opw-2664525

closes odoo/odoo#80113

Signed-off-by: default avatarJérémy Kersten <jke@odoo.com>
parent 0eaa4c0e
No related branches found
No related tags found
No related merge requests found
......@@ -42,4 +42,15 @@ export async function startWebClient(Webclient) {
// delete odoo.debug; // FIXME: some legacy code rely on this
odoo.__WOWL_DEBUG__ = { root };
odoo.isReady = true;
// Update Favicons
const favicon = `/web/image/res.company/${env.services.company.currentCompany.id}/favicon`;
const icons = document.querySelectorAll("link[rel*='icon']");
const msIcon = document.querySelector("meta[name='msapplication-TileImage']");
for (const icon of icons) {
icon.href = favicon;
}
if (msIcon) {
msIcon.content = favicon;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment