summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-22 14:55:17 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit3f8569a05702a8d14f18e8303e2f9418ec65a287 (patch)
tree0566e821c1b45e3d3c6e253197a8409c7e63fbbf /addons/web/static/src/js/views/basic/basic_model.js
parenteaa66d11568b415b8d6b4c7a17a058b5ec1df4a6 (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js2
1 files changed, 1 insertions, 1 deletions
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) {