How to Change Browser Tab Title in Odoo 17
By default, Odoo 17 dynamically sets the browser tab title based on the current menu or action (e.g., "Odoo - Sales"). However, in some cases, you may want to force a fixed title for branding or usability reasons. This article shows how to override the default behavior and set a custom browser tab title.
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { WebClient } from "@web/webclient/webclient"
import {patch} from "@web/core/utils/patch";
import { useService,useBus } from "@web/core/utils/hooks";
// Changes Odoo to My Title in window title
patch(WebClient.prototype, {
setup() {
super.setup();
const titleService = useService("title");
const fixed_title= "YOUR COMPANY"
titleService.setParts({ zopenerp: fixed_title, action:null });
useBus(this.env.bus, 'ACTION_MANAGER:UI-UPDATED', (mode) => {
titleService.setParts({ zopenerp: fixed_title, action:null });
document.title=fixed_title
});
},
});
Reply