Odoo - OpenERP - how to change web page browser title with custom module or customization?

| 2 1 2
Asked on 7/25/15, 7:38 AM

The title is set using the standard html <title tag in /addons/web/views/webclient_templates.xml in the web.layout template:

<template id="web.layout" name="Web layout">&lt;!DOCTYPE html&gt;
            <html style="height: 100%">
                    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
                    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
                    <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 ''"/>
                <body t-att-class="body_classname">
                    <t t-raw="0"/>

So you can change it in a xml file in a custom module, like this:

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

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


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

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

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

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

Be sure you do all the necessary for odoo to include your js file, see some examples of simple webclient modules, e.g. web_dialog_size

With these 2 modifications, you should see your custom page title in all the Odoo pages.

| 2 1 2
Answered on 7/25/15, 7:43 AM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This forum is for HiTechnologia Employees & just Odoo general knowledge purpose only.

Read Guidelines

Question tools

3 follower(s)


Asked: 7/25/15, 7:38 AM
Seen: 10120 times
Last updated: 7/25/15, 7:43 AM