From 52555c3edbd82866c91b78df3617283b54560ed8 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 24 Nov 2014 16:05:01 +0100 Subject: [PATCH] [ADD] hide advanced filter menu if there is no filter and nothing checked --- .../static/src/js/web_advanced_filters.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web_advanced_filters/static/src/js/web_advanced_filters.js b/web_advanced_filters/static/src/js/web_advanced_filters.js index 1c3dd505..ae1a8ea1 100644 --- a/web_advanced_filters/static/src/js/web_advanced_filters.js +++ b/web_advanced_filters/static/src/js/web_advanced_filters.js @@ -117,6 +117,7 @@ openerp.web_advanced_filters = function(instance) }, advanced_filters_show: function(ids) { + var self = this; if(this.sidebar) { this.sidebar.$el.show(); @@ -125,9 +126,20 @@ openerp.web_advanced_filters = function(instance) $e = jQuery(e) if($e.find('li.oe_advanced_filters_header').length) { + var search = self.ViewManager.searchview + .build_search_data(); + $e.find('a[data-index="0"],a[data-index="1"],' + + 'a[data-index="2"],a[data-index="3"]') + .parent().toggle( + search.contexts.length > 0 || + search.domains.length > 0); $e.find('a[data-index="4"],a[data-index="5"],' + 'a[data-index="6"],a[data-index="7"]') .parent().toggle(ids.length > 0); + $e.toggle( + search.contexts.length > 0 || + search.domains.length > 0 || + ids.length > 0); } else {