İçereği Atla
Menü
Bu soru işaretlendi
5 Cevaplar
3931 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici En İyi Yanıt

Does not working 

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
May 24
4191
1
Ağu 25
2123
2
Nis 24
1802
3
Mar 24
5378
0
Oca 24
1249