Port .github Copilot setup to Claude Code: - CLAUDE.md: condensed project instructions (auto-loaded each session) - .claude/skills: per-language guides (odoo-python, odoo-xml-views, odoo-qweb-html, odoo-javascript) + openspec-* workflow skills - .claude/commands/opsx: /opsx:explore|propose|apply|archive slash commands Original .github/ files kept untouched as extended reference. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| odoo-xml-views | XML/Odoo views conventions for this repo (XPath, inheritance, IDs, security, manifest data). Use when editing .xml views, security/, or XML data in Odoo addons. |
|
XML (Odoo Views)
Style and conventions
- Indentation: 4 spaces (no tabs).
- XPath with explicit
position:before,after,inside,replace,attributes. - Reference groups via
module.xml_id(e.g.sales_team.group_sale_manager). sequenceto order fields in views.- IDs:
module.descriptive_namepattern. - No conditional logic in QWeb, only access to attributes prepared in the controller.
- Translate strings in XML, never with
_()in Python field definitions.
Key patterns
- Views in
views/*.xml. Typical manifestdataorder:security/ir.model.access.csv,views/actions.xml,views/menu.xml,views/<model>_views.xml. - Security:
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink. - Common groups:
base.group_user,base.group_system,sales_team.group_sale_manager,purchase.group_purchase_manager.
Common mistakes
- XPath not found → check inheritance chain and correct XML IDs.
- Complex logic in QWeb → move it to the controller (see
docs/QWEB_BEST_PRACTICES.md).