更改Odoo 11标题栏

时间:2018-10-15 09:38:39

标签: javascript odoo-11

我想在浏览器中更改odoo的页面标题  我在新模块中添加了.JS,但这是针对Odoo 9

openerp.title_365 = 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": "My_title"});
            return this._super();
            },
        });
}

我发现在此link中,
如何更改为odoo 11

2 个答案:

答案 0 :(得分:2)

使用下面的js代码。

注意:不要忘记更改模块名称。

odoo.define('<your module name>.AbstractWebClient', function (require) {
"use strict";

var ActionManager = require('web.ActionManager');
var concurrency = require('web.concurrency');
var core = require('web.core');
var config = require('web.config');
var crash_manager = require('web.crash_manager');
var data_manager = require('web.data_manager');
var Dialog = require('web.Dialog');
var Loading = require('web.Loading');
var mixins = require('web.mixins');
var NotificationManager = require('web.notification').NotificationManager;
var RainbowMan = require('web.rainbow_man');
var session = require('web.session');
var Widget = require('web.Widget');

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

AbstractWebClient.include({
 init: function (parent) {
        this.client_options = {};
        mixins.ServiceProvider.init.call(this);
        this._super(parent);
        this.origin = undefined;
        this._current_state = null;
        this.menu_dm = new concurrency.DropMisordered();
        this.action_mutex = new concurrency.Mutex();
        this.set('title_part', {"zopenerp": "My Title"});
    },
 })
});

答案 1 :(得分:0)

您可以按照以下设置在登录页面上更改标题

  1. 激活开发者模式
  2. 转到用户界面,然后单击视图
  3. 搜索布局,然后选择web.layout模板
  4. 从此处更改标题
  5. 根据需要编辑标题