[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-726f5a48-3625-4650-bd66-70bf4bb0e67e":3,"$ffVpvL5Hq0BCoCQN7O3FEtjFbvfUNV4Pmcckc1uI5Lfk":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"726f5a48-3625-4650-bd66-70bf4bb0e67e","odoo-xml-views-builder","精通构建Odoo XML视图：表单、列表、看板、搜索、日历和图表。为Odoo 14-17生成正确的XML，并使用正确的可见性语法。","cat_life_career","mod_other","sickn33,other","---\nname: odoo-xml-views-builder\ndescription: \"Expert at building Odoo XML views: Form, List, Kanban, Search, Calendar, and Graph. Generates correct XML for Odoo 14-17 with proper visibility syntax.\"\nrisk: safe\nsource: \"self\"\n---\n\n# Odoo XML Views Builder\n\n## Overview\n\nThis 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+).\n\n## When to Use This Skill\n\n- Creating a new form or list view for a custom model.\n- Adding fields, tabs, or smart buttons to an existing view.\n- Building a Kanban view with color coding or progress bars.\n- Creating a search view with filters and group-by options.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-xml-views-builder` and describe the view you want.\n2. **Generate**: Get complete, ready-to-paste XML view definitions.\n3. **Review**: Paste existing XML and get fixes for common mistakes.\n\n## Examples\n\n### Example 1: Form View with Tabs\n\n```xml\n\u003Crecord id=\"view_hospital_patient_form\" model=\"ir.ui.view\">\n    \u003Cfield name=\"name\">hospital.patient.form\u003C\u002Ffield>\n    \u003Cfield name=\"model\">hospital.patient\u003C\u002Ffield>\n    \u003Cfield name=\"arch\" type=\"xml\">\n        \u003Cform string=\"Patient\">\n            \u003Cheader>\n                \u003Cbutton name=\"action_confirm\" string=\"Confirm\"\n                    type=\"object\" class=\"btn-primary\"\n                    invisible=\"state != 'draft'\"\u002F>\n                \u003Cfield name=\"state\" widget=\"statusbar\"\n                    statusbar_visible=\"draft,confirmed,done\"\u002F>\n            \u003C\u002Fheader>\n            \u003Csheet>\n                \u003Cdiv class=\"oe_title\">\n                    \u003Ch1>\u003Cfield name=\"name\" placeholder=\"Patient Name\"\u002F>\u003C\u002Fh1>\n                \u003C\u002Fdiv>\n                \u003Cnotebook>\n                    \u003Cpage string=\"General Info\">\n                        \u003Cgroup>\n                            \u003Cfield name=\"birth_date\"\u002F>\n                            \u003Cfield name=\"doctor_id\"\u002F>\n                        \u003C\u002Fgroup>\n                    \u003C\u002Fpage>\n                \u003C\u002Fnotebook>\n            \u003C\u002Fsheet>\n            \u003Cchatter\u002F>\n        \u003C\u002Fform>\n    \u003C\u002Ffield>\n\u003C\u002Frecord>\n```\n\n### Example 2: Kanban View\n\n```xml\n\u003Crecord id=\"view_hospital_patient_kanban\" model=\"ir.ui.view\">\n    \u003Cfield name=\"name\">hospital.patient.kanban\u003C\u002Ffield>\n    \u003Cfield name=\"model\">hospital.patient\u003C\u002Ffield>\n    \u003Cfield name=\"arch\" type=\"xml\">\n        \u003Ckanban default_group_by=\"state\" class=\"o_kanban_small_column\">\n            \u003Cfield name=\"name\"\u002F>\n            \u003Cfield name=\"state\"\u002F>\n            \u003Cfield name=\"doctor_id\"\u002F>\n            \u003Ctemplates>\n                \u003Ct t-name=\"kanban-card\">\n                    \u003Cdiv class=\"oe_kanban_content\">\n                        \u003Cstrong>\u003Cfield name=\"name\"\u002F>\u003C\u002Fstrong>\n                        \u003Cdiv>Doctor: \u003Cfield name=\"doctor_id\"\u002F>\u003C\u002Fdiv>\n                    \u003C\u002Fdiv>\n                \u003C\u002Ft>\n            \u003C\u002Ftemplates>\n        \u003C\u002Fkanban>\n    \u003C\u002Ffield>\n\u003C\u002Frecord>\n```\n\n## Best Practices\n\n- ✅ **Do:** Use inline `invisible=\"condition\"` (Odoo 17+) instead of `attrs` for show\u002Fhide logic.\n- ✅ **Do:** Use `attrs=\"{'invisible': [...]}\"` only if you are targeting Odoo 14–16 — it is deprecated in v17.\n- ✅ **Do:** Always set a `string` attribute on your view record for debugging clarity.\n- ✅ **Do:** Use `\u003Cchatter\u002F>` (v17) or `\u003Cdiv class=\"oe_chatter\">` + field tags (v16 and below) for activity tracking.\n- ❌ **Don't:** Use `attrs` in Odoo 17 — it is fully deprecated and raises warnings in logs.\n- ❌ **Don't:** Put business logic in view XML — keep it in Python model methods.\n- ❌ **Don't:** Use hardcoded `domain` strings in views when a `domain` field on the model can be used dynamically.\n\n## Limitations\n\n- Does not cover **OWL JavaScript widgets** or client-side component development.\n- **Search panel views** (`\u003Csearchpanel>`) are not fully covered — those require frontend knowledge.\n- Does not address **website QWeb views** — use `@odoo-qweb-templates` for those.\n- **Cohort and Map views** (Enterprise-only) are not covered by this skill.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,194,1284,"2026-05-16 13:32:45",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"75abf545-7123-4ac8-a747-b475550a1a85","1.0.0","odoo-xml-views-builder.zip",1779,"uploads\u002Fskills\u002F726f5a48-3625-4650-bd66-70bf4bb0e67e\u002Fodoo-xml-views-builder.zip","9914c2b5dd75e96dec9a11136a01fb58d2b497aa94e68f1a8336251ea8bb6153","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4136}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]