diff --git a/web_action_conditionable/__manifest__.py b/web_action_conditionable/__manifest__.py index e5049104..f8001d6c 100644 --- a/web_action_conditionable/__manifest__.py +++ b/web_action_conditionable/__manifest__.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- { "name": 'web_action_conditionable', - "version": "10.0.1.0.0", + "version": "10.0.0.1.0", "depends": [ - 'base', - 'web', + 'web' ], 'data': ['views/view.xml'], "author": "Cristian Salamea,Odoo Community Association (OCA)", diff --git a/web_action_conditionable/static/src/js/views.js b/web_action_conditionable/static/src/js/views.js index af0a3494..2733c353 100644 --- a/web_action_conditionable/static/src/js/views.js +++ b/web_action_conditionable/static/src/js/views.js @@ -1,24 +1,27 @@ -odoo.define('web.web_action_conditionable', function (require) { - "use strict"; +/*global openerp, _, $ */ +odoo.define('web_action_conditionable', function(require){ + "use strict"; - var View = require('web.View'); + var View = require('web.view'); - View.include({ - is_action_enabled: function(action) { - var attrs = this.fields_view.arch.attrs; - if (action in attrs) { - try { - return this._super(action); - } catch(error) { - var expr = attrs[action]; - var expression = py.parse(py.tokenize(expr)); - var cxt = this.dataset.get_context().__eval_context.__contexts[1]; - var result = py.evaluate(expression, cxt).toJSON(); - return result - } - } else { - return true; - } - } - }); + View.include({ + + is_action_enabled: function(action){ + var attrs = this.fields_view.arch.attrs; + if (action in attrs) { + try { + return this._super(action); + } catch(error) { + var expr = attrs[action]; + var expression = py.parse(py.tokenize(expr)); + var cxt = this.dataset.get_context().__eval_context.__contexts[1]; + var result = py.evaluate(expression, cxt).toJSON(); + return result + } + } else { + return true; + } + } + + }); }); diff --git a/web_action_conditionable/views/view.xml b/web_action_conditionable/views/view.xml index 494c2fe6..f4d9bd8f 100644 --- a/web_action_conditionable/views/view.xml +++ b/web_action_conditionable/views/view.xml @@ -1,8 +1,10 @@ - + + +