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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
2431
查看
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
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
10月 23
|
3330 | ||
|
0
1月 25
|
1050 | ||
|
1
9月 23
|
6932 | ||
|
0
9月 23
|
3018 |