summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2021-03-04 12:35:36 +0000
committerGéry Debongnie <ged@odoo.com>2021-03-04 12:46:32 +0000
commitd9834e65ee57511f4850fa2d74287eb0b67087b9 (patch)
tree7bb18715b4f177d0d3a5998f4931e46954dab149 /addons/web/static/src/js/views/basic
parent97fb335e3f70a55b18685b9b6b08fe0162e1a17b (diff)
[FIX] web: properly apply onchange in some cases
A previous commit (8dbd1efef899fb637acca3c318ae99cb23838b8f) fixed a part of the basicmodel that used _.each to iterate on an object with field names as keys, which does not work when a field is named "length". To fix it, I simply used a native for ... in statement. However, I missed the fact that there was a second 'return' statement in the body of the closure given to _.each, so the onchange method returned prematurely. The fix is to simply use the continue statement in that case. closes odoo/odoo#67228 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js3
1 files changed, 2 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 e006f6bf8f9..4864417dbee 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1750,7 +1750,8 @@ var BasicModel = AbstractModel.extend({
} else {
var fieldInfo = record.fieldsInfo[viewType][name];
if (!fieldInfo) {
- return; // ignore changes of x2many not in view
+ // ignore changes of x2many not in view
+ continue;
}
var view = fieldInfo.views && fieldInfo.views[fieldInfo.mode];
list = self._makeDataPoint({