How to change or empty "Odoo" Title from browser page in odoo 17

216 views Asked by At

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 "odoo " title on the browser page and the below code do not show any error but the "Odoo" title is still show why?

This is the Screenshort:

This is the Screenshort

/** @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 });
            });
        }
    }
});
1

There are 1 answers

0
Kenly On

In Odoo 17, you don't need the patch name. You can find more details in the Patching code section:

patch(object, {
  fn() {
    super.fn(...arguments);
    // do other things
  },
});

The legacy rpc was removed. Check the remove legacy rpc commit, you will find examples on how to replace old code.

You can use the title service to read/modify the document title