@@ -264,7 +264,7 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) {
264264 'click .o_delete' : function ( e ) {
265265 this . remove_id ( $ ( e . target ) . parent ( ) . data ( 'id' ) ) ;
266266 } ,
267- 'click .badge ' : 'open_badge' ,
267+ 'click .o_badge_text ' : 'open_badge' ,
268268 'mousedown .o_colorpicker span' : 'update_color' ,
269269 'focusout .o_colorpicker' : 'close_color_picker' ,
270270 } ,
@@ -411,15 +411,17 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) {
411411 var self = this ;
412412 var open = ( self . options && self . is_option_set ( self . options . open ) ) ;
413413 if ( open ) {
414- self . mutex . exec ( function ( ) {
415- var id = parseInt ( $ ( ev . currentTarget ) . data ( 'id' ) ) ;
416- self . do_action ( {
417- type : 'ir.actions.act_window' ,
418- res_model : self . field . relation ,
419- views : [ [ false , 'form' ] ] ,
420- res_id : id ,
421- target : "new"
422- } ) ;
414+ this . mutex . exec ( function ( ) {
415+ var id = parseInt ( $ ( ev . target ) . parent ( ) . data ( 'id' ) ) ;
416+ if ( id ) {
417+ self . do_action ( {
418+ type : 'ir.actions.act_window' ,
419+ res_model : self . field . relation ,
420+ views : [ [ false , 'form' ] ] ,
421+ res_id : id ,
422+ target : "new"
423+ } ) ;
424+ }
423425 } . bind ( this ) ) ;
424426 } else {
425427 self . open_color_picker ( ev ) ;
0 commit comments