From 27dd19c0b9b5ccdf1e84509119ace6becb09ff6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 11 Jan 2018 15:24:56 +0100 Subject: [FIX] web: prevent crash in some rare cases When we have a form view with a one2many with an onchange, and with lines which contains a x2many, and more lines that the limit (so more than one page), and the read is not in the same order as what is displayed because we have a widget=handle, then we might have a problem when we delete one of the lines, if the onchanges tries to change the x2many. This is due to the fact that the order of the basicmodel datapoint is not preserved by the various operations going around. I think that we may still have a few other issues of this type, but it is actually quite difficult to establish. In any case, this situation is now properly handled. opw 804530 --- 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 3621b7c1227..a94e2fe9454 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2374,7 +2374,7 @@ var BasicModel = AbstractModel.extend({ }); record.data[fieldName] = list.id; if (!fieldInfo.__no_fetch) { - var def = self._readUngroupedList(list).then(function () { + var def = self._readUngroupedList(list).then(function (list) { return $.when( self._fetchX2ManysBatched(list), self._fetchReferencesBatched(list) -- cgit v1.2.3