I've been attempting to create an event for tags within a many2many field using the following JavaScript code:
var FieldMany2ManyTags = relationalField.FieldMany2ManyTags.include({
events: _.extend({}, FieldMany2ManyTags.prototype.events, {
'click .o_badge_text': '_onClickTag',
}),
_onClickTag: function(ev){
var tar = ev.target;
var tar1 = ev.currentTarget;
console.log('FieldMany2ManyTags1');
if(tar){
console.log('Test');
alert('many2many tag');
}
if(tar1){
console.log('Test');
alert('many2many tag');
}
},
});
});
However, I'm facing an issue where the event is not being triggered. Can someone please help me understand why this is happening? Any alternative solutions would be greatly appreciated. Thank you in advance.