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:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
1331
Views
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.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Aug 23
|
1960 | ||
|
0
May 23
|
1839 | ||
|
1
Jan 23
|
6354 | ||
|
1
Oct 22
|
2690 | ||
Override JS mail
Solved
|
|
3
Jul 21
|
4276 |