summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-03-27 13:54:46 +0000
committerAaron Bohy <aab@odoo.com>2020-03-30 13:33:40 +0000
commit009fe3e81bc982f25b052dc4430f6a232e4bff95 (patch)
tree1c8e08ea0a6ab533869df1658111113b949691c5 /addons/web/static/src/js
parent4fd30ecbc1207fc370688c32798dd78eb5cef0e8 (diff)
[FIX] web: list: keep header checkbox selected
... when toggling an optional field. This bug wasn't really important until now, but with the new selection mechanism, it could lead to weird situations (e.g. the selection box says that all records are selected, but the thead checkbox isn't checked). Part of task 2185145
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_renderer.js3
1 files changed, 3 insertions, 0 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 418c39b14e0..5cf4b022c5d 100644
--- a/addons/web/static/src/js/views/list/list_renderer.js
+++ b/addons/web/static/src/js/views/list/list_renderer.js
@@ -989,6 +989,9 @@ var ListRenderer = BasicRenderer.extend({
return _.contains(self.selection, $(el).data('id'));
});
$checked_rows.find('.o_list_record_selector input').prop('checked', true);
+ if ($checked_rows.length === self.$('.o_data_row').length) { // all rows are checked
+ self.$('thead .o_list_record_selector input').prop('checked', true);
+ }
}
});
return Promise.all([this._super.apply(this, arguments), prom]);