diff --git a/addons/web/static/src/legacy/debug_manager.js b/addons/web/static/src/legacy/debug_manager.js
index a99f679ef82..242272c1f0f 100644
--- a/addons/web/static/src/legacy/debug_manager.js
+++ b/addons/web/static/src/legacy/debug_manager.js
@@ -6,7 +6,6 @@ import { formatDateTime, parseDateTime } from "../core/l10n/dates";
import { _lt } from "../core/l10n/translation";
import { registry } from "../core/registry";
import { formatMany2one } from "../fields/format";
-import { json_node_to_xml } from "../views/view_utils";
const { hooks, tags } = owl;
const { useState } = hooks;
@@ -403,7 +402,8 @@ export function editView({ accessRights, action, component, env }) {
if (!accessRights.canEditView) {
return null;
}
- const { viewId, viewType } = component.widget;
+ let { view_id: viewId, type: viewType } = component.props.viewInfo;
+ viewType = viewType === "tree" ? "list" : viewType;
const displayName = action.views.find((v) => v.type === viewType).name.toString();
const description = env._t("Edit View: ") + displayName;
return {
diff --git a/addons/web/static/tests/core/debug/debug_manager_tests.js b/addons/web/static/tests/core/debug/debug_manager_tests.js
index 640f3551a20..1b9cdaf1c76 100644
--- a/addons/web/static/tests/core/debug/debug_manager_tests.js
+++ b/addons/web/static/tests/core/debug/debug_manager_tests.js
@@ -13,8 +13,9 @@ import { registerCleanup } from "../../helpers/cleanup";
import { makeTestEnv, prepareRegistriesWithCleanup } from "../../helpers/mock_env";
import { makeFakeDialogService, makeFakeLocalizationService } from "../../helpers/mock_services";
import { click, getFixture, legacyExtraNextTick, patchWithCleanup } from "../../helpers/utils";
-import { createWebClient, getActionManagerServerData } from "../../webclient/helpers";
+import { createWebClient, doAction, getActionManagerServerData } from "../../webclient/helpers";
import { openViewItem } from "@web/core/debug/debug_menu_items";
+import { editView } from "@web/legacy/debug_manager";
const { Component, hooks, mount, tags } = owl;
const { useSubEnv } = hooks;
@@ -296,4 +297,47 @@ QUnit.module("DebugMenu", (hooks) => {
assert.containsNone(webClient, ".modal");
assert.containsOnce(webClient, ".some_view");
});
+
+ QUnit.test("can edit a pivot view", async (assert) => {
+ const mockRPC = async (route, args) => {
+ if (args.method === "check_access_rights") {
+ return Promise.resolve(true);
+ }
+ };
+ prepareRegistriesWithCleanup();
+
+ patchWithCleanup(odoo, {
+ debug: true,
+ });
+
+ registry.category("debug").add("editViewItem", editView);
+ registry.category("services").add("debug", debugService);
+
+ const serverData = getActionManagerServerData();
+ serverData.actions[1234] = {
+ id: 1234,
+ xml_id: "action_1234",
+ name: "Reporting Ponies",
+ res_model: "pony",
+ type: "ir.actions.act_window",
+ views: [[18, "pivot"]],
+ };
+ serverData.views["pony,18,pivot"] = "