From 13aae100e2bc0589e2313fd4105b39c0eeea4db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 11 Dec 2018 13:51:04 +0000 Subject: [FIX] web: do not render invisible filters in search view In some cases, the web client may receive a search view with invisible filters. This is due to the way field_view_get works. For example, if there is a group on a filter, then this will be transformed into an invisible attribute. In that case, the search view should simply ignore the filter and not display it. This was broken in the recent control panel refactoring (note that the search view lacked the possibility of testing that kind of situation). closes odoo/odoo#29430 --- addons/web/static/src/js/views/control_panel/control_panel_view.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/control_panel/control_panel_view.js b/addons/web/static/src/js/views/control_panel/control_panel_view.js index 3ba7afb2a60..3f89ad9f637 100644 --- a/addons/web/static/src/js/views/control_panel/control_panel_view.js +++ b/addons/web/static/src/js/views/control_panel/control_panel_view.js @@ -199,6 +199,9 @@ var ControlPanelView = Factory.extend({ var groupNumber = 1; _.each(preFilters, function (preFilter) { + if (preFilter.attrs && preFilter.attrs.invisible) { + return; + } if (preFilter.tag !== currentTag || _.contains(['separator', 'field'], preFilter.tag)) { if (currentGroup.length) { if (currentTag === 'groupBy') { -- cgit v1.2.3