[MERGE] callback2deferred dataset.exec_workflow

bzr revid: al@openerp.com-20120930144916-aco0b10x4ykdddg6
This commit is contained in:
Antony Lesuisse 2012-09-30 16:49:16 +02:00
commit b634ca91a0
2 changed files with 3 additions and 4 deletions

View File

@ -749,10 +749,9 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
return this._model.call('name_create',
[name], {context: this._model.context()});
},
exec_workflow: function (id, signal, callback) {
exec_workflow: function (id, signal) {
return this._model.exec_workflow(id, signal)
.pipe(function (result) { return { result: result }; })
.then(callback);
.pipe(function (result) { return { result: result }; });
},
get_context: function(request_context) {
return this._model.context(request_context);

View File

@ -1219,7 +1219,7 @@ instance.web.View = instance.web.Widget.extend({
} 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, handler);
return dataset.exec_workflow(record_id, action_data.name).then(handler(r));
}
},
/**