Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
3773 มุมมอง

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 });
});
}
}
});


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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" });
    },
});
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Does not working 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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); } } });


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 24
3587
2
เม.ย. 24
1273
3
มี.ค. 24
4945
1
ก.พ. 24
1913
0
ม.ค. 24
1195