From 3f8569a05702a8d14f18e8303e2f9418ec65a287 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 22 Mar 2017 14:55:17 +0100 Subject: [FIX] web: send array domains to the server in domain field The `FieldDomain` was sending string domains instead of array domains to the server (by its associated `BasicModel._fetchSpecialDomain` function). The server does not do the conversion string -> array for domains, so the RPC broke everytime. This commit also modifies the `MockServer` so that tests also break when sending string domains. It also improves the way failed rpc are handled. Indeed when an rpc fails, its deferred is rejected with two arguments: the error object, and a JQuery event (that will display the error if not preventDefaulted). The mockRPC didn't pass the second one and thus there was a crash when reaching code that e.g. calls preventDefault on that event. Note: this also removes the stringify/parse of the error object as it is not a correct simulation of a server error object anyway. --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 023571d19a4..0c2bbd4d23e 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1551,7 +1551,7 @@ var BasicModel = AbstractModel.extend({ var def = $.Deferred(); this._rpc(domainModel, "search_count") - .args([domainValue]) + .args([Domain.prototype.stringToArray(domainValue)]) .withContext(context) .exec() .then(_.identity, function (error, e) { -- cgit v1.2.3