Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
4 Antworten
2191 Ansichten

how to custom title on odoo17 
import { WebClient } from "@web/webclient/webclient";

import {patch} from "@web/core/utils/patch";


patch(WebClient.prototype, "Web Window Title", {

    setup() {

        const title = document.title;

        this._super();

        this.title.setParts({ zopenerp: title });

    }

});


don't work for the v17 

Avatar
Verwerfen
Beste Antwort

Works for Odoo 17.
Hope this help:

/** @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";

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

This works in Odoo 17! 👍

Hi guys!
This works perfectly in odoo 17 for me.
My tip is create the file and add in manifest the file reference.
Sample:
-- create the file mymodulename/static/src/js/mymodulename-start.js and add the code sent by @Manuel Emilio.
-- add in __manisfest__.py file the code below, whether web.assets_backend already exists so just put the file name "mymodulename/static/src/js/mymodulename-start.js".

"assets": {
"web.assets_backend": [
"mymodulename/static/src/js/mymodulename-start.js",
],
},

Regards,

@Alexander Campos... I agree with you. It is a good way to handle it.

Beste Antwort

work for me thank you

Avatar
Verwerfen
Autor Beste Antwort

no :/

Avatar
Verwerfen
Beste Antwort

Hi, have you found the solution? I have the same problem.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Aug. 25
328
4
Mai 25
2806
2
Mai 25
6234
1
März 25
1874
4
März 25
4796