odoo-xml-views-builder
Expert at building Odoo XML views: Form, List, Kanban, Search, Calendar, and Graph. Generates correct XML for Odoo 14-17 with proper visibility synt…
它会碰到什么
扫了多少1 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
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.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
星标★ 46,490
本站分层T1
该仓技能数6676
原文件路径
plugins/agentic-awesome-skills-claude/skills/odoo-xml-views-builder/SKILL.md同一个仓库里的其他技能
同名技能的其他版本
有 3 个不同仓库或目录里都有叫 odoo-xml-views-builder 的技能。它们内容并不相同,别混用:
- sickn33/agentic-awesome-skills — Expert at building Odoo XML views: Form, List, Kanban, Search, Calendar, and Graph. Genera
- sickn33/agentic-awesome-skills — Expert at building Odoo XML views: Form, List, Kanban, Search, Calendar, and Graph. Genera