Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odgovori
3771 Prikazi

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
Opusti
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
Opusti
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
Opusti
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
Opusti
Avtor Best Answer

Does not working 

Avatar
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
maj 24
3581
2
apr. 24
1272
3
mar. 24
4938
1
feb. 24
1910
0
jan. 24
1195