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');
},
});
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
2366
มุมมอง
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.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ส.ค. 23
|
3007 | ||
|
0
พ.ค. 23
|
3250 | ||
|
1
ม.ค. 23
|
8037 | ||
|
1
ต.ค. 22
|
3695 | ||
Override JS mail
แก้ไขแล้ว
|
|
3
ก.ค. 21
|
5309 |