summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-03-29 22:01:07 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit8f8e8b6e0ea0500b9e63ab604967268672a3a352 (patch)
tree8e4bd62c82b96da4c75e63449937e41c2d0d4a7c /addons/web/static/src/js/core
parentc43a3a5045945658add54a220c02cf0f23c03833 (diff)
[FIX] web: Domain: don't return frozen domain
In a recent commit, the fields object describing all fields of a model is (deeply) frozen by the data_manager. As a consequence, if a field has a domain (represented by an Array), this domain is frozen as well. Moreover, when the function getDomain is called on a dataPoint, the returned domain is the one in fields, not a copy. Problem is that the Many2One field updates this domain to add the blacklisted ids, which produces an error if the domain is frozen.
Diffstat (limited to 'addons/web/static/src/js/core')
-rw-r--r--addons/web/static/src/js/core/domain.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/domain.js b/addons/web/static/src/js/core/domain.js
index 4749d736f2a..7b873926727 100644
--- a/addons/web/static/src/js/core/domain.js
+++ b/addons/web/static/src/js/core/domain.js
@@ -222,7 +222,7 @@ var Domain = collections.Tree.extend({
* @returns {Array}
*/
stringToArray: function (domain, evalContext) {
- if (!_.isString(domain)) return domain;
+ if (!_.isString(domain)) return _.clone(domain);
return pyeval.eval("domain", domain || "[]", evalContext);
},
/**