From f926318a7839f25972d6331655b47f15894847ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 21 Aug 2019 08:20:12 +0000 Subject: [IMP] web: keep dirty fields dirty Before this commit, a simple optimization was done: if a field was modified in such a way that the new value is the same as the initial value, then it is not considered changed. However, with the new changes in the ORM, it may be an issue, because doing so loses the intent of the user. If an onchange changes a field, then the user changes it back, the server is not aware of that fact. With this commit, we simply keep the field in the list of changes to send to the server. opw #2057230 closes odoo/odoo#35890 Signed-off-by: Raphael Collet (rco) --- addons/web/static/src/js/views/basic/basic_model.js | 6 ------ 1 file changed, 6 deletions(-) (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 289e8a3a0c2..f7005a11b9a 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1474,12 +1474,6 @@ var BasicModel = AbstractModel.extend({ resolve(_.keys(changes)); } }).then(function (fieldNames) { - _.each(fieldNames, function (name) { - if (record._changes && record._changes[name] === record.data[name]) { - delete record._changes[name]; - record._isDirty = !_.isEmpty(record._changes); - } - }); return self._fetchSpecialData(record).then(function (fieldNames2) { // Return the names of the fields that changed (onchange or // associated special data change) -- cgit v1.2.3