diff options
| author | Romeo Fragomeli <rfr@odoo.com> | 2020-10-08 08:20:25 +0000 |
|---|---|---|
| committer | Romeo Fragomeli <rfr@odoo.com> | 2020-12-08 12:04:36 +0000 |
| commit | c6c4b9f0e4bae03b51d232ea920de9587d8e2b73 (patch) | |
| tree | fd4a269aeb0d74af1ec22ab7c24855b008d43a34 /addons/web/static/src/js/views/list | |
| parent | 52bf0e331fb9230423b76b9014bb13d490930e76 (diff) | |
[FIX] web: don't update the list view if not needed
Before this commit, an event was triggered even when no change occurred.
Steps to reproduces:
* Go to Document
* Change to list view
* Go to app switcher
* Select another app that has enough content to be able to scroll
* Scroll the view => Bug
Task ID: 2347584
closes odoo/odoo#63012
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/list')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_renderer.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index 4571b1275a4..7559fda1063 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -1168,6 +1168,7 @@ var ListRenderer = BasicRenderer.extend({ * @private */ _updateSelection: function () { + const previousSelection = JSON.stringify(this.selection); this.selection = []; var self = this; var $inputs = this.$('tbody .o_list_record_selector input:visible:not(:disabled)'); @@ -1180,7 +1181,9 @@ var ListRenderer = BasicRenderer.extend({ } }); this.$('thead .o_list_record_selector input').prop('checked', allChecked); - this.trigger_up('selection_changed', { allChecked, selection: this.selection }); + if (JSON.stringify(this.selection) !== previousSelection) { + this.trigger_up('selection_changed', { allChecked, selection: this.selection }); + } this._updateFooter(); }, |
