diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-02-24 13:31:54 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | a9eac7766f6d45d08373595c96eb32aef8b60f3a (patch) | |
| tree | e314dd61fffa72c98a8c6aaf129bd5aeb420107c /addons/web/static/src/js | |
| parent | 167db67300fde595b9017f90ab87494db37adc6b (diff) | |
[IMP] web: allow to give perform[Model]RPC options
(already used by session.rpc)
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/core/mixins.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/services/ajax_service.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/src/js/core/mixins.js b/addons/web/static/src/js/core/mixins.js index 266888a3948..93468e03fc0 100644 --- a/addons/web/static/src/js/core/mixins.js +++ b/addons/web/static/src/js/core/mixins.js @@ -374,16 +374,16 @@ var ServicesMixin = { return result; }, // AJAX calls - performRPC: function (route, args) { - return this.call('ajax', 'rpc', route, args); + performRPC: function (route, args, options) { + return this.call('ajax', 'rpc', route, args || {}, options || {}); }, - performModelRPC: function (model, method, args, kwargs) { + performModelRPC: function (model, method, args, kwargs, options) { return this.performRPC('/web/dataset/call_kw/' + model + '/' + method, { model: model, method: method, args: args || [], kwargs: kwargs || {}, - }); + }, options || {}); }, loadFieldView: function (dataset, view_id, view_type, options) { return this.loadViews(dataset.model, dataset.get_context(), [[view_id, view_type]], options).then(function (result) { diff --git a/addons/web/static/src/js/services/ajax_service.js b/addons/web/static/src/js/services/ajax_service.js index e44893eb63f..dbcd851e203 100644 --- a/addons/web/static/src/js/services/ajax_service.js +++ b/addons/web/static/src/js/services/ajax_service.js @@ -6,8 +6,8 @@ var session = require('web.session'); var AjaxService = AbstractService.extend({ name: 'ajax', - rpc: function (route, args) { - return session.rpc(route, args); + rpc: function (route, args, options) { + return session.rpc(route, args, options); }, }); |
