diff --git a/addons/web/static/src/js/chrome/control_panel.js b/addons/web/static/src/js/chrome/control_panel.js index 03b9e756bb7..558dde933e9 100644 --- a/addons/web/static/src/js/chrome/control_panel.js +++ b/addons/web/static/src/js/chrome/control_panel.js @@ -252,9 +252,6 @@ var ControlPanel = Widget.extend({ */ _update_search_view: function (searchview, isHidden, groupable) { if (searchview) { - // Set the $buttons div (in the DOM) of the searchview as the $buttons - // have been appended to a jQuery node not in the DOM at SearchView initialization - searchview.$buttons = this.nodes.$searchview_buttons; searchview.toggle_visibility(!isHidden); if (groupable !== undefined){ searchview.groupby_menu.do_toggle(groupable); diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index f1356f72a81..1007aa6c720 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -320,7 +320,7 @@ var AbstractController = Widget.extend(ControlPanelMixin, { if (this.searchView) { _.extend(cpContent, { $searchview: this.searchView.$el, - $searchview_buttons: this.searchView.$buttons.contents(), + $searchview_buttons: this.searchView.$buttons, }); } this.update_control_panel({ diff --git a/addons/web/static/tests/chrome/action_manager_tests.js b/addons/web/static/tests/chrome/action_manager_tests.js index 26c5f0af537..46b613a4cfe 100644 --- a/addons/web/static/tests/chrome/action_manager_tests.js +++ b/addons/web/static/tests/chrome/action_manager_tests.js @@ -2658,6 +2658,31 @@ QUnit.module('ActionManager', { actionManager.destroy(); }); + QUnit.test("search menus are still available when switching between actions", function (assert) { + assert.expect(3); + + var actionManager = createActionManager({ + actions: this.actions, + archs: this.archs, + data: this.data, + }); + + actionManager.doAction(1); + assert.strictEqual($('.o_search_options .o_dropdown:visible .o_filters_menu').length, 1, + "the search options should be available"); + + actionManager.doAction(3); + assert.strictEqual($('.o_search_options .o_dropdown:visible .o_filters_menu').length, 1, + "the search options should be available"); + + // go back using the breadcrumbs + $('.o_control_panel .breadcrumb a:first').click(); + assert.strictEqual($('.o_search_options .o_dropdown:visible .o_filters_menu').length, 1, + "the search options should be available"); + + actionManager.destroy(); + }); + QUnit.module('Actions in target="new"'); QUnit.test('can execute act_window actions in target="new"', function (assert) { @@ -2839,7 +2864,6 @@ QUnit.module('ActionManager', { QUnit.test('doAction resolved with an action', function (assert) { assert.expect(4); - var done = assert.async(); this.actions.push({ id: 21, @@ -2862,7 +2886,6 @@ QUnit.module('ActionManager', { assert.strictEqual(action.type, 'ir.actions.act_window_close', "should be resolved with correct action type"); actionManager.destroy(); - done(); }); }); });