Build and Refine Odoo XML Views
A skill for generating and fixing Odoo XML views - Kanban, Form, List, Search, Calendar, Graph - across Odoo versions 14-17.
Why it matters
Automate the creation and review of Odoo XML view definitions for various view types (Kanban, Form, List, etc.) across Odoo versions 14-17, ensuring compatibility and adherence to best practices.
Outcomes
What it gets done
Generate complete XML view definitions for Odoo.
Review and fix existing Odoo XML view code.
Adapt XML views for Odoo 14-16 `attrs` and Odoo 17+ inline expressions.
Incorporate visibility modifiers, groups, domains, contexts, and widgets.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-odoo-xml-views-builder | bash Overview
Odoo XML Views Builder
This skill generates and reviews Odoo XML view definitions for Form, Kanban, List, Search, Calendar, and Graph views, handling version differences between Odoo 14-16's attrs syntax and 17+'s inline expressions. Use it when creating or fixing Odoo custom-model views. It does not cover OWL widgets, search panel views, website QWeb templates, or Enterprise-only Cohort/Map views.
What it does
This skill generates and reviews Odoo XML view definitions for Kanban, Form, List, Search, Calendar, and Graph views, understanding visibility modifiers, groups, domain, context, and widget usage across Odoo versions 14 through 17 - including the version 17 migration from attrs-based conditional logic to inline expressions like invisible="condition". It activates when mentioned with @odoo-xml-views-builder alongside a description of the desired view, generates complete ready-to-paste XML, or reviews and fixes existing XML for common mistakes. Example outputs include a form view with a header status-bar button, notebook tabs, and a chatter widget for activity tracking, and a Kanban view with default grouping by state and a custom card template showing patient name and doctor.
When to use - and when NOT to
Use it when 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, or creating a search view with filters and group-by options. It does not cover OWL JavaScript widgets or client-side component development, search panel views (searchpanel, which need frontend knowledge), website QWeb views (use @odoo-qweb-templates instead), or Cohort and Map views, which are Enterprise-only and outside this skill's scope.
Inputs and outputs
Given a description of the desired view, or existing XML to review, it produces complete record XML view definitions using ir.ui.view, or a corrected version of pasted XML with fixes flagged against its best-practice rules - such as replacing deprecated attrs with inline invisible expressions in Odoo 17, or moving hardcoded domain strings to a dynamic domain field on the model.
Integrations
Targets the Odoo XML view system - ir.ui.view records - directly, with no external tooling required beyond an Odoo instance to deploy the generated views into. The two worked examples in the source illustrate the record structure end to end: a patient form view wraps a header confirm button and statusbar widget, a title section, and a notebook tab with grouped fields inside a sheet, while the Kanban example sets default_group_by on the kanban element itself and defines the card layout through a kanban-card template.
Who it's for
Odoo developers and implementers building or fixing custom module views who need version-correct XML - avoiding deprecated attrs in v17, using dynamic domain fields instead of hardcoded strings, and keeping business logic in Python model methods rather than view XML - without manually tracking each Odoo version's view syntax differences. It also enforces a few sharp-edged conventions directly: always set a string attribute on the view record for debugging clarity, and use chatter (v17) or the older oe_chatter div-plus-field pattern (v16 and earlier) for activity tracking rather than mixing the two approaches.
Source README
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+).
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.