Update button_action with returned values
issue8766 review268241002
This commit is contained in:
1 parent
070951311f
commit
3c55448947
3 files changed
+20
-29
No files matched your search
+17
-26
@@ -204,33 +204,24 @@
|
||||
});
|
||||
};
|
||||
|
||||
Sao.Action.execute = function(id, data, type, context, keyword) {
|
||||
if (!type) {
|
||||
Sao.rpc({
|
||||
'method': 'model.ir.action.read',
|
||||
'params': [[id], ['type'], context]
|
||||
}, Sao.Session.current_session).done(function(result) {
|
||||
Sao.Action.execute(id, data, result[0].type, context, keyword);
|
||||
});
|
||||
} else {
|
||||
Sao.rpc({
|
||||
'method': 'model.' + type + '.fetch_action',
|
||||
'params': [id, context]
|
||||
}, Sao.Session.current_session).done(function(result) {
|
||||
var action = result[0];
|
||||
if (keyword) {
|
||||
var keywords = {
|
||||
'ir.action.report': 'form_report',
|
||||
'ir.action.wizard': 'form_action',
|
||||
'ir.action.act_window': 'form_relate'
|
||||
};
|
||||
if (!action.keyword) {
|
||||
action.keyword = keywords[type];
|
||||
}
|
||||
}
|
||||
Sao.Action.exec_action(action, data, context);
|
||||
});
|
||||
Sao.Action.execute = function(action, data, context, keyword) {
|
||||
if (typeof action == 'number') {
|
||||
action = Sao.rpc({
|
||||
'method': 'model.ir.action.get_action_value',
|
||||
'params': [action, context],
|
||||
}, null, false);
|
||||
}
|
||||
if (keyword) {
|
||||
var keywords = {
|
||||
'ir.action.report': 'form_report',
|
||||
'ir.action.wizard': 'form_action',
|
||||
'ir.action.act_window': 'form_relate'
|
||||
};
|
||||
if (!action.keyword) {
|
||||
action.keyword = keywords[action.type];
|
||||
}
|
||||
}
|
||||
Sao.Action.exec_action(action, data, context);
|
||||
};
|
||||
|
||||
Sao.Action.evaluate = function(action, atype, record) {
|
||||
|
||||
+1
-1
@@ -649,7 +649,7 @@
|
||||
id: record_id,
|
||||
ids: record_ids
|
||||
};
|
||||
Sao.Action.exec_action(exec_action, data,
|
||||
Sao.Action.execute(exec_action, data,
|
||||
jQuery.extend({}, screen.local_context));
|
||||
});
|
||||
}.bind(this))
|
||||
|
||||
+2
-2
@@ -93,8 +93,8 @@
|
||||
delete context.active_ids;
|
||||
delete context.active_model;
|
||||
delete context.action_id;
|
||||
Sao.Action.exec_action(action[0], action[1],
|
||||
context);
|
||||
Sao.Action.execute(
|
||||
action[0], action[1], context);
|
||||
}.bind(this));
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
Reference in new issue
Block a user