Skip to Content
Menu
This question has been flagged
5 Replies
3684 Views

the issue is that I have upgraded the module version 15 to version17 

where the "odoo" title is shown on the browser tab for example I have opened the odoo local server and I clicked the sale module then u see "Odoo-Quotation" or "Odoo-App" so I want to remove or empty "odoo " on the browser tab

can anybody help me


And the below is my code

** @odoo-module */ 
import { WebClient } from "@web/webclient/webclient" ;
import { patch } from "@web/core/utils/patch" ;
import { session } from "@web/session" ;
import { useService } from "@web/core/utils/hooks" ;

patch(WebClient.prototype, {
"legion_hide_odoo_tab.WebClient" : {
setup() {
this ._super.apply( this , arguments);
this .rpc = useService( "rpc" );
var domain = session.user_companies.allowed_companies;
this .title.setParts({ zopenerp: "" });
var obj = this ;
var def = rpc.query({
fields: [ 'name' , 'id' ,],
model: 'res.config.settings' ,
method : 'current_company_id' ,
args: [domain, domain],
})
.then( function (result) {
// const app_system_name = session.app_system_name || 'New title';
const app_system_name = session.app_system_name || '' ;
obj .title.setParts({ zopenerp: result });
});
}
}
});


Avatar
Discard
Best Answer

Hope this help.

Works for Odoo 17


/** @odoo-module **/

import { registry } from "@web/core/registry";
import { WebClient } from "@web/webclient/webclient"
import {patch} from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";

// Changes Odoo to My Title
patch(WebClient.prototype,  {
    setup() {
        super.setup();
        const titleService = useService("title");
        titleService.setParts({ zopenerp: "My Title" });
    },
});
Avatar
Discard
Best Answer

Hi,
You can use the following code.

** @odoo-module **/

import { registry } from "@web/core/registry";
import { WebClient } from "@web/webclient/webclient"
import {patch} from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";

// Changes Odoo to My Title in window title
patch(WebClient.prototype, {
setup() {
super.setup();
const title = useService("title");
title.setParts({ zopenerp: "My Title" });
},
});


Hope it helps

Avatar
Discard
Best Answer

From /odoo/addons/web/static/src/webclient/webclient.js
in community modules version 17

U could Find line

 this.title.setParts({ zopenerp: "My custom Tite" }); // zopenerp is easy to grep

u could replace "My  custom Title " to ur title and the upgrade module with technical name web

Avatar
Discard
Author Best Answer

Does not working 

Avatar
Discard
Best Answer

Consider directly overriding the setTitleParts method within the patch to have more control over title construction.

Example:

patch(WebClient.prototype, { 'legion_hide_odoo_tab.WebClient': { setTitleParts(parts) { parts = parts.filter(part => part.name !== 'zopenerp'); // Remove 'zopenerp' part this._super(parts); } } });


Avatar
Discard
Related Posts Replies Views Activity
2
May 24
3484
2
Apr 24
1223
3
Mar 24
4795
1
Feb 24
1856
0
Jan 24
1156