con un clic
odoo-basic-views
Define List, Form, and Search views in XML.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Define List, Form, and Search views in XML.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
A router skill that identifies and recommends the most appropriate Odoo skill for a given user request.
Create HTTP endpoints for Websites and APIs.
Comprehensive guide to Odoo fields, including basic, relational, computed, and robust technical features (indexing, company_dependent, properties).
Master the Odoo ORM for data manipulation, environment management, and CRUD operations.
Configure Access Control Lists (ACLs) using CSV files.
Write automated tests using TransactionCase and Form emulators to ensure code quality.
| name | Odoo Basic Views |
| description | Define List, Form, and Search views in XML. |
Customize the List (Tree), Form, and Search views for estate.property.
Views are records in the ir.ui.view model, defined in XML files.
Basic Structure:
<record id="view_estate_property_list" model="ir.ui.view">
<field name="name">estate.property.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<!-- View Architecture Goes Here -->
</field>
</record>
Stat buttons (Smart Buttons) are placed inside a div with class oe_button_box at the top of the form sheet.
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_offers" type="object" class="oe_stat_button" icon="fa-money">
<field name="offer_count" string="Offers" widget="statinfo"/>
</button>
</div>
<!-- ... Rest of the sheet ... -->
</sheet>
type="object": Calls a Python method action_view_offers.type="action": Triggers a Window Action (needs name="%(action_xml_id)d").widget="statinfo": Formats the count nicely.ir.ui.view)Defines the search bar behavior (Search, Filter, Group By).
<search string="Search Property">
<field name="name"/>
<field name="postcode"/>
<filter string="New" name="filter_new" domain="[('state', '=', 'new')]"/>
<group expand="1" string="Group By">
<filter string="Postcode" name="group_postcode" context="{'group_by':'postcode'}"/>
</group>
</search>
Used for reporting.
<!-- Graph View -->
<record id="view_estate_property_graph" model="ir.ui.view">
<field name="model">estate.property</field>
<field name="arch" type="xml">
<graph string="Property Prices" type="bar">
<field name="property_type_id"/>
<field name="selling_price" type="measure"/>
</graph>
</field>
</record>
<!-- Pivot View -->
<record id="view_estate_property_pivot" model="ir.ui.view">
<field name="model">estate.property</field>
<field name="arch" type="xml">
<pivot string="Property Analysis">
<field name="property_type_id" type="row"/>
<field name="expected_price" type="measure"/>
</pivot>
</field>
</record>
<list>)Displays records in a table.
<list> (previously <tree>).Example:
<list string="Properties">
<field name="name"/>
<field name="postcode"/>
<field name="selling_price"/>
<field name="date_availability"/>
</list>
<form>)Displays a single record.
<form>.<sheet>, <group>, <notebook>, <page>.Example:
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="tag_ids" widget="many2many_tags"/>
</group>
<group>
<field name="start_date"/>
</group>
</group>
<notebook>
<page string="Description">
<field name="description"/>
</page>
</notebook>
</sheet>
</form>
<search>)Defines search, filter, and group by options.
<search>.Example:
<search>
<field name="name"/>
<field name="postcode"/>
<!-- Filter: default domain -->
<filter string="Available" name="available" domain="[('state', 'in', ('new', 'offer_received'))]"/>
<!-- Group By -->
<filter string="Postcode" name="groupby_postcode" context="{'group_by': 'postcode'}"/>
</search>
A domain is a list of criteria to select a subset of records.
Syntax: [('field_name', 'operator', value)]
& (AND) is default.| (OR) prefix.! (NOT) prefix.XML Safety: Use < for < and > for >.
Use --dev xml when running the server to update views on browser refresh without restarting Odoo.
./odoo-bin -u estate --dev xml