diff options
| author | Holger Brunn <hbrunn@therp.nl> | 2015-12-01 17:38:53 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2015-12-28 14:06:47 +0100 |
| commit | 704b3cec9f37f76c5e1adad88d2a33b86ea11ed7 (patch) | |
| tree | fc9a8151144c52ea6f2e1f6738b9d3bbab061c03 /addons/web/static/src | |
| parent | b3f3c67eea0168235cec5c4246f9720286ced7dc (diff) | |
[FIX] web: keep o2m current page in correct range
when going through different form view records
For example, when being on page 4 of a o2m then switching to next form
view record, if this new record did not have 4 pages for this o2m, the
o2m was shown empty (and if there was no page, the o2m became unusable)
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index ae2cac633ff..351d46643c5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4606,7 +4606,14 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ this.dataset.evict_record(record.get('id')); return this._super(record); - } + }, + reload_content: function () { + this.page = Math.min( + this.page, + Math.ceil(this.dataset.size() / this.limit()) - 1 + ); + return this._super.apply(this, arguments); + }, }); instance.web.form.One2ManyGroups = instance.web.ListView.Groups.extend({ setup_resequence_rows: function () { |
