跳至內容
選單
此問題已被標幟
2 回覆
2363 瀏覽次數
My goal is to change the Page title using the company name. I am trying to change the function but stil there's no effect. Any idea on how to achieve this?

varsession = require('web.session');
varAbstractWebClient = require('web.AbstractWebClient');
AbstractWebClient.include({
_title_changed:function () {
this._super();
var company_name = session.user_companies.current_company[1];
document.title = company_name;console.log('_title_changed function');
},
});


頭像
捨棄
作者 最佳答案

Hi, This is what I did and it's working fine on my end:


odoo.define('mymodule.AbstractWebClient', function (require) {
"use strict";
/**
* AbstractWebClient Override Method for Page Title using Company Name
*/

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

AbstractWebClient.include({
_title_changed:function () {
this._super();
var company_name = session.user_companies.current_company[1];
document.title = company_name;
},
});

return AbstractWebClient;
});

頭像
捨棄
最佳答案

Hi, 
Show us the declaration of your js file.
Then add console.log('==========') after var session line to check if odoo reads the file
then add another one inside yuour fnution to check if it's printed too.

waiting for your reply.

Regards.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
8月 23
3003
0
5月 23
3249
1
1月 23
8037
1
10月 22
3695
3
7月 21
5308