Skip to Content
Menu
This question has been flagged
5 Replies
39119 Views

How to change the title of the page from to any custom title


I have already extended the web.layout , web.login_layout. I want to change the dynamic page title of odoo in a custom module. Please tell me if there is any other way other than changing web_client.js file's zopenerp property.  I also tried to override the init function in web_client.js but it is not working


openerp.edit_title_module = function(instance) {
    // THIS CONSOLE LOG IS PRINTING
    consloe.log("Print 1")
    instance.web.webclient.extend({
        init: function(parent, client_options) {
            // BUT THIS CONSOLE LOG IS NOT EXECUTING
            consloe.log("Print 2")
            this._super(parent, client_options);
            this.set('title_part', {"zopenerp": "My custom title"});
        },
    });
};

Avatar
Discard

What title do you mean? Can you provide a screenshot?

Author

I mean the page's title appearing in browser's tab, I am not able to edit the question,When ever I try to edit and save, It shows 403 forbidden that's why I am not able to post a screen shot

You can add a link to a screenshot here as a comment.

Best Answer

In Odoo 10, you have to change 

this.set('title_part', {"zopenerp": "Your Company Name"});

in web/static/src/js/abstract_web_client.js file.

Avatar
Discard
Best Answer

Thank alls,


I used code below for Odoo V13 and it's worked.

odoo.define('your_module_name.WebClient', function (require) {

"use strict";

    var AbstractWebClient = require('web.AbstractWebClient');

    AbstractWebClient = AbstractWebClient.include({

        start: function (parent) {

            this.set('title_part', {"zopenerp": "Your title!"});

            this._super(parent);

        },

    });

});


Avatar
Discard

Hi, this worked perfectly for me!

Regards.

Hi all, I'm using Odoo v15, I tried this but it doesn't seem to work with me. Is there any solution? Thank alls

Author Best Answer

I got the answer for the My question 

https://stackoverflow.com/questions/40418642/odoo-9-inherit-js-file


Visit this stack overflow link, This is working in Odoo 9 


openerp.module_name = function(instance){
    var _t = instance.web._t,
    _lt = instance.web._lt;
    var QWeb = instance.web.qweb;

    instance.web.WebClient.include({

        start: function() {
            this.set('title_part', {"zopenerp": "Odoo9"});
            return this._super();
            },
        });
}
Avatar
Discard
Best Answer

hai,

after changing 

this.set('title_part', {"zopenerp": "Odoo9"}); to 

this.set('title_part', {"zopenerp": "Your required name"}); try to open the localhost in another browser. This was because of cache that wont allow the changes in present browser
Avatar
Discard
Best Answer

There is a free module that lets you change the title. Plus it conveniently adds a field in the settings menu so you can change the title anytime instead of hard-coding it. It's available for a whole bunch of Odoo versions.

https://apps.odoo.com/apps/modules/13.0/web_window_title/

And even if you don't want to install it it's very helpful to look up/compare your code.

Avatar
Discard
Related Posts Replies Views Activity
3
Aug 24
5507
4
Jul 24
38820
5
Apr 23
93756
3
Nov 22
2959
3
Aug 22
3042