odoo-xml-views-builder – skill Khác cho agent AI
Chuyên gia xây dựng XML view cho Odoo: Form, List, Kanban, Search, Calendar và Graph. Tạo XML đúng cho Odoo 14-17 với cú pháp visibility chuẩn.
Cài skill odoo-xml-views-builder bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-xml-views-builder-b27e8.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /odoo-xml-views-builder – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-xml-views-builder-b27e8.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $odoo-xml-views-builder – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-xml-views-builder-b27e8.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /odoo-xml-views-builder – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-xml-views-builder-b27e8.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /odoo-xml-views-builder – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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
1. Activate: Mention @odoo-xml-views-builder and describe the view you want.
2. Generate: Get complete, ready-to-paste XML view definitions.
3. Review: Paste existing XML and get fixes for common mistakes.
Examples
These examples target Odoo 17 and require the custom model, fields and methods. For v14–16, convert dynamic modifiers to attrs domains. View visibility is not access control: enforce ACLs, record rules and method authorization separately.
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>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</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-box">
<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 no longer supported in v17. - ✅ Do: Set the
ir.ui.viewrecord'snamefield; use supportedstringattributes on the architecture elements that accept them. - ✅ Do: For Odoo 17, use the
oe_chatterblock and ensure the model inherits the required mail mixins; verify syntax against the exact target version. - ❌ Don't: Use
attrsin Odoo 17 — it is unsupported and can prevent view loading. - ❌ 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.
Reference: [Odoo 17 view architectures](https://www.odoo.com/documentation/17.0/developer/reference/user_interface/view_architectures.html).
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.
Skill liên quan
- offboarding-exit – Sổ theo dõi nghỉ việc: loại nghỉ, nhân viên và quản lý, thông báo và ngày cuối, lý do…
- offer-appointment – Sổ theo dõi thư mời làm việc: ứng viên, vị trí, phòng ban, loại hình làm việc, mức lương…
- okr-system – Sổ đăng ký OKR: mục tiêu, người phụ trách và cấp độ, phòng ban, quý và năm, tối đa ba…
- okta-attack – Chuỗi tấn công red-team với Okta làm IdP
- ollama-stack – Chạy khối lượng công việc LLM cục bộ với Ollama, Open WebUI và tinh chỉnh theo GPU cho…
- on-call-handoff-patterns – Các mẫu hiệu quả khi bàn giao ca trực on-call, đảm bảo tính liên tục, truyền ngữ cảnh và…
- onboarding-playbook – Checklist onboarding: bước, giai đoạn và thứ tự, phòng ban, người phụ trách, SOP liên…
- oneroster-csv-validator – Kiểm tra bộ CSV danh sách lớp OneRoster v1.1 và v1.2 của 1EdTech / IMS Global: tính toàn…