[IMP]remove callback from exec_workflow method and update related code.
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>
Fri, 28 Sep 2012 09:44:23 +0000 (15:14 +0530)
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>
Fri, 28 Sep 2012 09:44:23 +0000 (15:14 +0530)
bzr revid: vme@tinyerp.com-20120928094423-r7zpurqq0dbr6cyr

addons/web/static/src/js/data.js
addons/web/static/src/js/views.js

index 55bc923..cab0cc7 100644 (file)
@@ -751,10 +751,9 @@ instance.web.DataSet =  instance.web.CallbackEnabled.extend({
             [name], {context: this._model.context()})
                 .then(callback);
     },
-    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);
index e7748a3..8a7fc52 100644 (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));
         }
     },
     /**