summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorHardik Prajapati <hap@odoo.com>2020-07-10 09:18:31 +0000
committerAaron Bohy <aab@odoo.com>2020-07-27 12:54:57 +0000
commit7aafa205090c558d3d52eb893762c00a70ca307f (patch)
tree02b1214ba5fcebf1525bdb22874946fb24fc4c23 /addons/web/static/src/js
parent97425653af800239f2b4175440788d88a54f693a (diff)
[FIX] web: list: hide export button when list empty
Before this commit, at first rendering, the export button was displayed in the list view even if the list was empty. The issue occurred because at first rendering, the buttons aren't moved inside the control panel yet (this is done in the 'mounted' hook of the control panel). As we render in a fragment, the hook is called later on, when everything is ready and inserted into the DOM. We'll get rid of these painful manipulations as soon as everything will be converted to OWL. Task 2294306 closes odoo/odoo#54307 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_controller.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js
index 12a3e8c75e1..24dbc4683dd 100644
--- a/addons/web/static/src/js/views/list/list_controller.js
+++ b/addons/web/static/src/js/views/list/list_controller.js
@@ -174,9 +174,9 @@ var ListController = BasicController.extend({
this.$buttons.toggleClass('o-editing', mode === 'edit');
const state = this.model.get(this.handle, {raw: true});
if (state.count) {
- this.$('.o_list_export_xlsx').show();
+ this.$buttons.find('.o_list_export_xlsx').show();
} else {
- this.$('.o_list_export_xlsx').hide();
+ this.$buttons.find('.o_list_export_xlsx').hide();
}
}
this._updateSelectionBox();