odoo-xml-views-builder
它能做什么
这个 AI 代理可以帮你编写和修复 Odoo 的 XML 代码。Odoo 是一套企业管理系统。它可以生成表单、列表和看板等视图,用来组织和展示信息。
适用场景
- ✓创建一个用来录入客户资料的新表单时。
- ✓在销售界面中添加商品列表时。
- ✓用可视化看板(Kanban)整理信息,跟踪任务进度时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-xml-views-builder/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为“Product”模型创建一个 XML 表单,包含 “name”、“price” 和 “description” 字段。”
每周 5 个新技能,1 分钟读完。
工作原理
你描述需要的视图类型(表单、列表等)以及对应的数据模型。AI 会生成可直接在 Odoo 中使用的 XML 代码,或者帮你检查你已有的代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Odoo XML Views Builder
Overview
This skill generates and reviews Odoo XML view definitions for Kanban, Form, List, Search, Calendar, and Graph views. It understands visibility modifiers, groups, domain, context, and widget usage across Odoo versions 14–17, including the migration from attrs (v14–16) to inline expressions (v17+).
When to Use This Skill
- Creating a new form or list view for a custom model.
- Adding fields, tabs, or smart buttons to an existing view.
- Building a Kanban view with color coding or progress bars.
- Creating a search view with filters and group-by options.
How It Works
- Activate: Mention
@odoo-xml-views-builderand describe the view you want. - Generate: Get complete, ready-to-paste XML view definitions.
- Review: Paste existing XML and get fixes for common mistakes.
Examples
Example 1: Form View with Tabs
<record id="view_hospital_patient_form" model="ir.ui.view">
<field name="name">hospital.patient.form</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<form string="Patient">
<header>
<button name="action_confirm" string="Confirm"
type="object" class="btn-primary"
invisible="state != 'draft'"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,confirmed,done"/>
</header>
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="Patient Name"/></h1>
</div>
<notebook>
<page string="General Info">
<group>
<field name="birth_date"/>
<field name="doctor_id"/>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
Example 2: Kanban View
<record id="view_hospital_patient_kanban" model="ir.ui.view">
<field name="name">hospital.patient.kanban</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<kanban default_group_by="state" class="o_kanban_small_column">
<field name="name"/>
<field name="state"/>
<field name="doctor_id"/>
<templates>
<t t-name="kanban-card">
<div class="oe_kanban_content">
<strong><field name="name"/></strong>
<div>Doctor: <field name="doctor_id"/></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
Best Practices
- ✅ Do: Use inline
invisible="condition"(Odoo 17+) instead ofattrsfor show/hide logic. - ✅ Do: Use
attrs="{'invisible': [...]}"only if you are targeting Odoo 14–16 — it is deprecated in v17. - ✅ Do: Always set a
stringattribute on your view record for debugging clarity. - ✅ Do: Use
<chatter/>(v17) or<div class="oe_chatter">+ field tags (v16 and below) for activity tracking. - ❌ Don't: Use
attrsin Odoo 17 — it is fully deprecated and raises warnings in logs. - ❌ Don't: Put business logic in view XML — keep it in Python model methods.
- ❌ Don't: Use hardcoded
domainstrings in views when adomainfield on the model can be used dynamically.
Limitations
- Does not cover OWL JavaScript widgets or client-side component development.
- Search panel views (
<searchpanel>) are not fully covered — those require frontend knowledge. - Does not address website QWeb views — use
@odoo-qweb-templatesfor those. - Cohort and Map views (Enterprise-only) are not covered by this skill.
常见问题
Odoo 中的 XML 视图是什么?
它们是定义信息在屏幕上如何呈现给用户的代码片段,比如数据录入表单、商品列表或跟踪看板。
“Kanban”、“Form”和“List”视图分别是什么?
“Form”用于一次查看和编辑一条记录。“List”以行的形式显示多条记录。“Kanban”用卡片来表示每条记录,适合用于工作流程管理。
“Odoo 14-17”是什么意思?
它表示这段代码兼容的 Odoo 版本范围。不同版本之间,代码可能需要做少量调整。
详情
作者的原始描述
Expert at building Odoo XML views: Form, List, Kanban, Search, Calendar, and Graph. Generates correct XML for Odoo 14-17 with proper visibility syntax.
热度
- GitHub 星标
- 48k
- 排名
- #5356
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。