summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-03-22 08:22:57 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commitf7a8c1b276ed841c02c9aeb5cf0f5e21c32fd33b (patch)
tree09b482a50b203879e908bdc59573ece703f371fd /addons/web/static/src/js
parentd75a7b850a7e6db7db238f7fe1404d717d4ffd67 (diff)
[FIX] web: rpc: call route: don't override given params
When calling a route using the new RPC query builder (e.g. by doing "this._rpc('/a/route').params({a: 'a'}).exec()"), if one of the route kwargs was 'model', 'method', 'args' or 'kwargs', the given value was overriden by undefined.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/core/rpc.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/rpc.js b/addons/web/static/src/js/core/rpc.js
index c18c7ac6809..a6d314f35a2 100644
--- a/addons/web/static/src/js/core/rpc.js
+++ b/addons/web/static/src/js/core/rpc.js
@@ -97,12 +97,13 @@ var BaseRPCBuilder = Class.extend({
if (this._context) {
kwargs.context = this._context;
}
- return _.extend({}, this._params, {
+ var params = {
method: this._method,
model: this._model,
args: this._args || (this._method ? [] : undefined),
kwargs: this._method ? kwargs : undefined,
- });
+ };
+ return _.defaults(params, this._params);
},
/**
* @private