My goal is to modify the method _onClickSend() in https://github.com/odoo/odoo/blob/879647265bf804e63bd8e89ec3ca58b51ffb29ea/addons/mail/static/src/components/composer/composer.js#L284. Could anybody explain or show an example to inherit and modify this method trough a custom module? For example: i want the function to look as follows:
_onClickSend() {
this._postMessage();
console.log("Click Send");
this.focus();
}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilitate
- Inventar
- PoS
- Project
- MRP
Această întrebare a fost marcată
1
Răspunde
2416
Vizualizări
Hi,
Try like below code
odoo.define('module_name.file_name', function (require) {
"use strict";
const Composer = require('mail/static/src/components/composer/composer.js');
const { patch } = require('web.utils');
patch(Composer, 'file path or a unique string', {
_onClickSend() {
this._super();
}
})
});
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
1
oct. 23
|
3321 | ||
|
0
ian. 25
|
1043 | ||
How to render owl template from JS?
Rezolvat
|
|
1
sept. 23
|
6921 | |
|
0
sept. 23
|
3006 |