mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
FIX
testing in all cases is better catch errno in JSON.parse. attrs[action] is always “string” type.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user