Files
shcool/college/data/shixun_module_data.xml
T

41 lines
3.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- ===================== 动作:打开应用列表(ir.module.module) ===================== -->
<!-- kanban 是第一个 view_mode,直接用 view_id 指定实训模块专用看板视图;
list/form 走系统默认,无需额外的 ir.actions.act_window.view 记录 -->
<record id="action_shixun_module" model="ir.actions.act_window">
<field name="name">实训模块</field>
<field name="res_model">ir.module.module</field>
<field name="view_mode">kanban,list,form</field>
<field name="view_id" ref="shixun_module_kanban_view"/>
<!-- 过滤目标:与教育/物管实训无关的模块不显示(只过滤、不删模块),使列表收敛到 50 条。
两层过滤,分工不同:
1) category_id 排除(下方 id 清单)——按类目粗过滤。
警告:类目 id 跨数据库不一致!2026-10-16 核对企业库(school)实际映射为
13=CRM、20=人力资源、45=未分类、99=Education、102=Game、114=Custom……,
本地开发库又是另一套(旧注释里 13=Education 之类的映射两边都不对,已作废)。
此清单按企业库现状保留;要改先查目标库 ir_module_category,否则会误伤。
2) name 排除(模块名,跨库稳定)——精确微调数量。
2026-10-16 企业库匹配 56 条,排除以下 6 个教学实训用不上的 Odoo 原生小应用后
精确收敛到 50 条(显示 1-50 / 50,无第 2 页):
preview_easy(附件预览) room(会议室) lunch(午餐)
data_recycle(数据清理) marketing_card(营销卡片) project_todo(待办)
增长兜底:以后再装新模块总数会超过 50,module_list_cap.js 把显示硬顶在 50
(第 2 页点不动、每页数锁定);想把总数重新收敛回 50,按第 2 层加模块名即可。 -->
<field name="domain">[('application', '=', True), ('category_id', 'not in', [13, 54, 71, 15, 94, 6, 10, 11, 20, 33, 55, 37, 59, 21, 89, 90, 92, 103, 28, 32, 88, 23]), ('name', 'not in', ['preview_easy', 'room', 'lunch', 'data_recycle', 'marketing_card', 'project_todo'])]</field>
<!-- shixun_hide_empty_categories:搜索面板「类别」列过滤掉计数为 0 的类别
(见 models/ir_module_module_info.py 对 search_panel_select_range 的包装) -->
<field name="context">{'shixun_hide_empty_categories': True}</field>
<field name="search_view_id" ref="shixun_module_search_view"/>
<field name="limit">50</field>
</record>
<!-- ===================== 菜单:一级菜单,点进去显示 ir.module.module 的应用列表 ===================== -->
<menuitem id="menu_shixun_module"
name="实训模块"
web_icon="college,static/src/img/shixun_module.png"
action="action_shixun_module"
sequence="30"
groups="college.group_teacher,college.group_student,base.group_system"/>
</odoo>