diff --git a/web_widget_boolean_switch/static/src/js/web_widget_boolean_switch.js b/web_widget_boolean_switch/static/src/js/web_widget_boolean_switch.js index 279e4de9..8bab7979 100644 --- a/web_widget_boolean_switch/static/src/js/web_widget_boolean_switch.js +++ b/web_widget_boolean_switch/static/src/js/web_widget_boolean_switch.js @@ -172,9 +172,10 @@ openerp.web_widget_boolean_switch = function(instance){ _format: function (row_data, options, readonly) { return _.str.sprintf('', - row_data[this.id].value ? 'checked="checked"' : '', - readonly ? 'readonly' : '', - row_data.hasOwnProperty('id') ? row_data.id.value : -1); + row_data[this.id].value ? 'checked="checked"' : '', + readonly ? 'readonly' : '', + row_data.hasOwnProperty('id') && _.isNumber(row_data.id.value) ? + row_data.id.value : -1); } });