Odoo 8 - how to change the page title?

I was wondering how to change the page titles and remove Odoo from it?

https://www.odoo.com/forum/help-1/question/change-login-page-title-34874 I tried this but couldn't find anything.

+3


source to share


4 answers


The title is set using the standard html tag <title

in /addons/web/views/webclient_templates.xml in the templateweb.layout

:

<template id="web.layout" name="Web layout">&lt;!DOCTYPE html&gt;
            <html style="height: 100%">
                <head>
                    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
                    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
                    <title>Odoo</title>
                    <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
                    <link rel="stylesheet" href="/web/static/src/css/full.css" />
                    <t t-raw="head or ''"/>
                </head>
                <body t-att-class="body_classname">
                    <t t-raw="0"/>
                </body>
            </html>
        </template>

      

So, you can change it in XML file in custom module, for example:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
  <data>

    <template id="custom_title" name="change title" inherit_id="web.layout">
      <xpath expr="//title" position="replace">
        <title>Your title</title>
      </xpath>
    </template>

  </data>
</openerp>

      

Make sure to declare the xml file in your manifest file and reload the module.



This works for the login page (if the selected database has a module with the change set), but it won't work on most other pages because when the view is loaded, the title is changed dynamically by the javascript client, (to reflect the view you are in, for example, "Products - Odoo", or "Customers - Oduo")

To change this, you have to extend the JS web client and edit it like this:

openerp.your_module_name = function(instance) {
    instance.web.WebClient.include({
        init: function(parent, client_options) {
            this._super(parent, client_options);
            this.set('title_part', {"zopenerp": "Your Title"});
        },
    });
};

      

Make sure you do whatever is necessary for odoo to include your js file, see some examples of simple webclient modules for example. web_dialog_size

With these two modifications, you should see your own page title across all Odoo pages.

+6


source


I was looking for community version 9, you need to look at the file:

addons / web / static / src / js / web_client.js

Change this code:



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

With the help of this:

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

+3


source


In Odoo 10, the above solutions don't work. For Odoo 10 we need to edit below JS file

addons/web/static/src/js/abstract_web_client.js

Change this code:

this.set('title_part', {"zopenerp": "

Odoo "});

With the help of this:

this.set('title_part', {"zopenerp": "

MyPageTitle "});

After that, you will restart your Odoo server to see the changes.

+3


source


1- In additions /web/static/src/js/chrome.js: Search all words containing "Odoo" and replace

2- after: Search for local modules -> module named " Web " -> update

-1


source







All Articles