I want to add one more event in "mail.Chatter" template(mail/static/src/js/chatter.js). so I extend the "mail.Chatter" like below
odoo.define('override_chatter.override_chatter', function (require) {
"use strict";
var Chatter = require('mail.Chatter');
console.log('Chatter', Chatter)
var Chatter_Extend = Chatter.Chatter.extend({
init: function (parent, dataset, options) {
this._super(parent, options);
this.events = _.extend(this.events, {
"click .o_composer_button_chatter_link": "on_open_o_composer_button_chatter",
});
},
});
});
But from the console, i got some error. Please check below.
Chatter function Class(){if(this.constructor!==OdooClass){throw new Error("You can only instanciate objects with the 'new' operator");}
Please correct me if am wrong.Is there any other method to override this "mail.Chatter" template?