Ir al contenido
Menú
Se marcó esta pregunta
5 Respuestas
3718 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Autor Mejor respuesta

Does not working 

Avatar
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
may 24
3516
2
abr 24
1234
3
mar 24
4838
1
feb 24
1879
0
ene 24
1179