[MERGE] callback2deferred dataset.call_button (and fix exec_workflow)

bzr revid: al@openerp.com-20120930151538-ka35fozw40v99e71
This commit is contained in:
Antony Lesuisse
2012-09-30 17:15:38 +02:00
2 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -706,9 +706,8 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
* @param {Function} error_callback
* @returns {$.Deferred}
*/
call_button: function (method, args, callback, error_callback) {
return this._model.call_button(method, args)
.then(callback, error_callback);
call_button: function (method, args) {
return this._model.call_button(method, args);
},
/**
* Fetches the "readable name" for records, based on intrinsic rules
@@ -1043,7 +1042,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
}
return completion.promise();
},
call_button: function (method, args, callback, error_callback) {
call_button: function (method, args) {
var id = args[0][0], index;
for(var i=0, len=this.cache.length; i<len; ++i) {
var record = this.cache[i];
@@ -1054,7 +1053,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
break;
}
}
return this._super(method, args, callback, error_callback);
return this._super(method, args);
},
alter_ids: function(n_ids) {
this._super(n_ids);
+2 -2
View File
@@ -1215,11 +1215,11 @@ instance.web.View = instance.web.Widget.extend({
}
}
args.push(context);
return dataset.call_button(action_data.name, args, handler);
return dataset.call_button(action_data.name, args).then(handler);
} else if (action_data.type=="action") {
return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}, handler);
} else {
return dataset.exec_workflow(record_id, action_data.name).then(handler(r));
return dataset.exec_workflow(record_id, action_data.name).then(handler);
}
},
/**