diff options
| author | Géry Debongnie <ged@odoo.com> | 2019-08-21 08:20:12 +0000 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2019-08-21 08:27:42 +0000 |
| commit | f926318a7839f25972d6331655b47f15894847ad (patch) | |
| tree | 5e589372fc93b96b0a3ef32a2e22179d23a53eb8 /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 0133426ec72f71116501d0e9f605757a8f5f3f13 (diff) | |
[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) <rco@openerp.com>
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.js | 6 |
1 files changed, 0 insertions, 6 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 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) |
