diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-03-14 12:04:46 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-03-14 17:03:23 +0100 |
| commit | 7287c672f54126781854fea2412e50fbf9702bc3 (patch) | |
| tree | acccd281ae77962a35992c988bc8be699c8c9edc /addons/web/static/src/js/views | |
| parent | 4586b876f273181b57f3f3fe4b0dce2a2d26b27a (diff) | |
[FIX] web: x2m: properly reset limit/offset to initial value
When we discard an element, we want to make sure that the new state is
not corrupted by previous user operations. In our case, we possibly had
a limit and an offset values modified by the user.
This could lead to unpleasant situations, with incorrect data displayed
on the form view.
Note that this actually fixes a new bug introduced by commit
https://github.com/odoo/odoo/commit/e7fab234201e357da52c3576ad2e8fc9ceee9359
(this is the commit that introduces the tempLimitIncrement attribute)
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 5 |
1 files changed, 5 insertions, 0 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 f081d0a6caa..949eb68cefc 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -359,6 +359,11 @@ var BasicModel = AbstractModel.extend({ elem._changes = null; elem._isDirty = false; } + elem.offset = 0; + if (elem.tempLimitIncrement) { + elem.limit -= elem.tempLimitIncrement; + delete elem.tempLimitIncrement; + } }); }, /** |
