I try to inherit onClickSendMessage() of mail chatter js in odoo 15 https://github.com/odoo/odoo/blob/15.0/addons/mail/static/src/models/chatter/chatter.js#L140
here is my js code
/** @odoo-module **/
import { patch } from 'web.utils';
import { Chatter } from '@mail/components/chatter/chatter';
patch(Chatter.prototype, 'my_custom_module/static/src/js/chatter.js', {
onClickSendMessage(ev) {
if (this.composerView && !this.composerView.composer.isLog) {
this.update({ composerView: clear() });
} else {
this.showSendMessage();
}
}
});
But when i click on this, my custom module function not call. Anyone can help ? how to can i do this.
Patch mail.chatter
model using registerInstancePatchModel which is used to register a patch for instance methods in model
Example:
/** @odoo-module **/
import { registerInstancePatchModel } from "@mail/model/model_core";
registerInstancePatchModel("mail.chatter", "custom_send_message", {
onClickSendMessage() {
},
});