Form View Widget System
Odoo widgets control how fields are rendered and edited in form views. Each field type has a default widget, but you can override it with the widget attribute to change the UI behavior. This reference covers every commonly used widget and its options.
Text and Char Widgets
char (default for Char fields)
Standard single-line text input.
<field name="name"/>
<field name="email" widget="email"/>
<field name="phone" widget="phone"/>
<field name="url" widget="url"/>
The email, phone, and url widgets add clickable links and platform-specific behavior (phone widget opens dialer on mobile).
text (default for Text fields)
Multi-line textarea:
<field name="description" widget="text"/>
html
Rich text editor with formatting toolbar:
<field name="body_html" widget="html"
options="{'collaborative': false}"/>
char_domain
Domain editor widget for building Odoo search domains visually:
<field name="domain" widget="domain"
options="{'model': 'res.partner'}"/>
Number Widgets
integer, float (defaults)
<field name="quantity"/>
<field name="weight" digits="[16, 3]"/>
monetary
Displays value with currency symbol, requires a currency field:
<field name="currency_id" invisible="1"/>
<field name="amount" widget="monetary"
options="{'currency_field': 'currency_id'}"/>
percentage
<field name="discount" widget="percentage"/>
progressbar
Shows a numeric field as a visual progress bar:
<field name="completion" widget="progressbar"
options="{'editable': true, 'max_value': 'planned_hours'}"/>
Relational Field Widgets
many2one (default)
Dropdown with autocomplete:
<field name="partner_id"/>
<field name="partner_id"
options="{'no_create': true, 'no_open': true}"/>
Options: no_create hides the Create option, no_open prevents opening the related record, no_create_edit hides Create and Edit.
many2one_avatar / many2one_avatar_user
Shows the related record's avatar image alongside the name:
<field name="user_id" widget="many2one_avatar_user"/>
many2many_tags
Renders a Many2many as colored tags:
<field name="tag_ids" widget="many2many_tags"
options="{'color_field': 'color',
'no_create_edit': true}"/>
many2many_checkboxes
Renders each option as a checkbox:
<field name="category_ids" widget="many2many_checkboxes"/>
one2many (default)
Renders as an inline list/tree within the form:
<field name="line_ids">
<list editable="bottom">
<field name="product_id"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="subtotal"/>
</list>
</field>
Selection Widgets
selection (default)
Standard dropdown:
<field name="state"/>
radio
Renders as radio buttons:
<field name="priority" widget="radio"/>
statusbar
Progress bar at the top of the form:
<field name="state" widget="statusbar"
statusbar_visible="draft,confirmed,done"/>
priority
Star rating widget:
<field name="priority" widget="priority"/>
Date and Time Widgets
<field name="date_start"/>
<field name="datetime_end" widget="remaining_days"/>
<field name="date_deadline" widget="daterange"
options="{'related_end_date': 'date_end'}"/>
The remaining_days widget shows the number of days until/since the date. The daterange widget links start and end dates.
Binary and Image Widgets
<field name="image_1920" widget="image"
options="{'preview_image': 'image_128', 'size': [90, 90]}"/>
<field name="attachment" widget="binary"/>
<field name="signature" widget="signature"/>
Layout and Decoration
Groups and Notebooks
<form>
<sheet>
<group>
<group string="General">
<field name="name"/>
<field name="partner_id"/>
</group>
<group string="Details">
<field name="date_start"/>
<field name="user_id"/>
</group>
</group>
<notebook>
<page string="Lines" name="lines">
<field name="line_ids"/>
</page>
<page string="Notes" name="notes">
<field name="internal_notes"/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
Decoration Attributes
Add conditional styling to list and form fields:
<field name="amount"
decoration-danger="amount > 10000"
decoration-success="amount <= 1000"
decoration-warning="state == 'draft'"/>
Available decorations: decoration-info, decoration-success, decoration-warning, decoration-danger, decoration-muted, decoration-bf (bold), decoration-it (italic).
Invisible, Readonly, Required
Control field behavior based on conditions:
<field name="approval_date"
invisible="state != 'approved'"
readonly="state == 'done'"
required="state == 'approved'"/>
In Odoo 17+, these attributes accept Python-like expressions directly (no need for attrs dict).
Widget Options Summary
Most widgets accept an options dict in JSON format. Common cross-widget options include: no_create, no_open, no_quick_edit. Always check the widget source code for available options since not all are documented.