35 lines
960 B
JavaScript
35 lines
960 B
JavaScript
/** @odoo-module **/
|
|
|
|
import { registry } from "@web/core/registry";
|
|
import { _t } from "@web/core/l10n/translation";
|
|
|
|
function quickMenuConfigItem(env) {
|
|
const actionService = env.services.action;
|
|
|
|
return {
|
|
type: "item",
|
|
id: "quick_menu_config",
|
|
description: _t("快捷菜单配置"),
|
|
sequence: 45, // 放在分隔符和设置之间
|
|
|
|
async callback() {
|
|
try {
|
|
await actionService.doAction({
|
|
type: "ir.actions.act_window",
|
|
name: _t("快捷菜单配置"),
|
|
res_model: "quick.menu.config",
|
|
view_mode: "list,form",
|
|
views: [[false, "list"], [false, "form"]],
|
|
context: { search_default_active: 1 },
|
|
target: "current",
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to load quick menu config action:", error);
|
|
}
|
|
},
|
|
};
|
|
}
|
|
|
|
// 注册到用户菜单
|
|
registry.category("user_menuitems").add("quick_menu_config", quickMenuConfigItem);
|