diff options
| author | Antony Lesuisse <al@openerp.com> | 2012-09-30 17:15:38 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2012-09-30 17:15:38 +0200 |
| commit | c5bcb0e53f5414f7692ea2f57f2bacf5d009bd3f (patch) | |
| tree | b641253f54869020db22cbe876f7efc0ab3d2eb2 /addons/web/static | |
| parent | 1a369bfd3cdd898fcd1b64de17a2fc57e9b5e852 (diff) | |
| parent | 7730c14855162bf57b1fd20d4524bf506ab2e8d5 (diff) | |
[MERGE] callback2deferred dataset.call_button (and fix exec_workflow)
bzr revid: al@openerp.com-20120930151538-ka35fozw40v99e71
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/data.js | 9 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index a9a06400357..894bb4857b4 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -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); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 8a7fc52e02a..9e7db823bc0 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -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); } }, /** |
