diff --git a/addons/web/static/src/views/pivot/pivot_view.js b/addons/web/static/src/views/pivot/pivot_view.js index 4b647a2aad9..a472decf515 100644 --- a/addons/web/static/src/views/pivot/pivot_view.js +++ b/addons/web/static/src/views/pivot/pivot_view.js @@ -4,11 +4,10 @@ import { _lt } from "@web/core/l10n/translation"; import { download } from "@web/core/network/download"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; -import { ControlPanel } from "@web/search/control_panel/control_panel"; -import { SearchPanel } from "@web/search/search_panel/search_panel"; import { useModel } from "@web/views/helpers/model"; import { standardViewProps } from "@web/views/helpers/standard_view_props"; import { useSetupView } from "@web/views/helpers/view_hook"; +import { Layout } from "@web/views/layout"; import { PivotArchParser } from "@web/views/pivot/pivot_arch_parser"; import { PivotModel } from "@web/views/pivot/pivot_model"; import { PivotRenderer } from "@web/views/pivot/pivot_renderer"; @@ -130,8 +129,9 @@ export class PivotView extends Component { }); // retrieve form and list view ids from the action + const { views = [] } = this.env.config; this.views = ["list", "form"].map((viewType) => { - const view = this.props.info.views.find((view) => view[1] === viewType); + const view = views.find((view) => view[1] === viewType); return [view ? view[0] : false, viewType]; }); @@ -157,7 +157,7 @@ export class PivotView extends Component { PivotView.template = "web.PivotView"; PivotView.buttonTemplate = "web.PivotView.Buttons"; -PivotView.components = { ControlPanel, SearchPanel, Renderer: PivotRenderer }; +PivotView.components = { Renderer: PivotRenderer, Layout }; PivotView.props = { ...standardViewProps, diff --git a/addons/web/static/src/views/pivot/pivot_view.xml b/addons/web/static/src/views/pivot/pivot_view.xml index f53659259ab..9ebf438f8cc 100644 --- a/addons/web/static/src/views/pivot/pivot_view.xml +++ b/addons/web/static/src/views/pivot/pivot_view.xml @@ -17,30 +17,26 @@ -
- - - + + + + + + + + - -
- - - - - - - - - - - -
-
+ + + + + +
diff --git a/addons/web/static/tests/views/pivot_view_tests.js b/addons/web/static/tests/views/pivot_view_tests.js index 6aeb591dfaf..d511b682fa8 100644 --- a/addons/web/static/tests/views/pivot_view_tests.js +++ b/addons/web/static/tests/views/pivot_view_tests.js @@ -6,19 +6,21 @@ import { session } from "@web/session"; import { makeFakeLocalizationService, makeFakeUserService } from "../helpers/mock_services"; import { click, - nextTick, legacyExtraNextTick, makeDeferred, mockDownload, + nextTick, patchDate, patchWithCleanup, triggerEvent, triggerEvents, } from "../helpers/utils"; -import { makeView } from "./helpers"; import { applyGroup, editFavoriteName, + removeFacet, + saveFavorite, + selectGroup, setupControlPanelFavoriteMenuRegistry, setupControlPanelServiceRegistry, toggleAddCustomGroup, @@ -26,15 +28,13 @@ import { toggleFavoriteMenu, toggleFilterMenu, toggleGroupByMenu, + toggleMenu, toggleMenuItem, toggleMenuItemOption, toggleSaveFavorite, - saveFavorite, - selectGroup, - removeFacet, - toggleMenu, } from "../search/helpers"; import { createWebClient, doAction } from "../webclient/helpers"; +import { makeView } from "./helpers"; const serviceRegistry = registry.category("services"); @@ -438,12 +438,14 @@ QUnit.module("Views", (hooks) => { `, context: { someKey: true, search_default_test: 3 }, - views: [ - [2, "form"], - [5, "kanban"], - [false, "list"], - [false, "pivot"], - ], + config: { + views: [ + [2, "form"], + [5, "kanban"], + [false, "list"], + [false, "pivot"], + ], + }, }); assert.hasClass(pivot.el.querySelector("table"), "o_enable_linking"); @@ -4689,7 +4691,9 @@ QUnit.module("Views", (hooks) => { serverData, context: { search_default_small_than_0: true }, noContentHelp: '

click to add a foo

', - views: [[false, "search"]], + config: { + views: [[false, "search"]], + }, }); assert.containsOnce(pivot, ".o_view_nocontent .abc"); @@ -4720,7 +4724,9 @@ QUnit.module("Views", (hooks) => { serverData, context: { search_default_small_than_0: true }, noContentHelp: '

click to add a foo

', - views: [[false, "search"]], + config: { + views: [[false, "search"]], + }, }); assert.hasClass(pivot.el, "o_view_sample_data"); @@ -4753,7 +4759,9 @@ QUnit.module("Views", (hooks) => { resModel: "partner", serverData, noContentHelp: '

click to add a foo

', - views: [[false, "search"]], + config: { + views: [[false, "search"]], + }, }); assert.doesNotHaveClass(pivot.el, "o_view_sample_data");