diff --git a/web_action_conditionable/static/src/js/views.js b/web_action_conditionable/static/src/js/views.js index 9daf279c..c9713913 100644 --- a/web_action_conditionable/static/src/js/views.js +++ b/web_action_conditionable/static/src/js/views.js @@ -5,9 +5,10 @@ openerp.web_action_conditionable = function (instance) { is_action_enabled: function(action) { var attrs = this.fields_view.arch.attrs; if (action in attrs) { - if ($.type(attrs[action]) == 'boolean') { - return JSON.parse(attrs[action]) - } else { + try { + data = JSON.parse(attrs[action]); + return data; + } catch(error) { var expr = attrs[action]; var expression = py.parse(py.tokenize(expr)); var cxt = this.dataset.get_context().__eval_context.__contexts[1];