Skip to main content
iVentureTeam

event_icon_selection

event_icon_selection turns a field's value into an icon, and its configuration is unlike any other widget on this site: the options dictionary itself is the icon map, with every key you write becoming a supported value.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 26, 2026Updated August 26, 20266 min read
Technical nameevent_icon_selection
Field typeschar, text, selection
Viewslist (core); registered for any view
Moduleevent
Used in core2 occurrences across 1 module: the mail_state column of the event communication list in event
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. Applied in XML; Studio does not list it
Alternativesstate_selection, event_state_selection, selection_badge, badge

What the Icon Selection widget does

On an event form, the Communication tab lists the scheduled emails and SMS with a small status icon per row: a check for sent, an hourglass for scheduled, gears for running, a cross for cancelled. That column is event_icon_selection.

The component is refreshingly small: a template that renders one <i> tag, an icon getter that looks the current field value up in a map, and a title getter that builds the tooltip. What makes it worth a page is where the map comes from: extractProps forwards the entire options dictionary as the icon map. There is no declared option name; the option keys are your field's values and the option values are complete icon class strings.

It supports char, text and selection fields, because all it needs is a string to look up. Whatever the field type, the widget is pure display: it renders no input in any mode and never writes the record.

What this means for your team

Status columns are where list views win or lose their readability. Text statuses make every row the same visual weight; icon statuses let the eye find the exceptions, the canceled cross among twenty green checks, without reading a word.

The event communication list is a good template for the pattern: a scheduler table where each row's state is instantly visible in a 20-pixel column. The same recipe works for any custom model with a small, closed set of states, quality check results, sync statuses, document stages, wherever your team scans rather than reads.

Because the icon map lives in the view XML rather than in code, adapting it is a view edit, not a module: adding a new state to the map is one more key in the options dict, which also makes it one of the few widgets a functional consultant can reconfigure end to end without touching JavaScript.

Working examples

How core applies it (event communication list)

<field name="mail_state" widget="event_icon_selection" string=" " nolabel="1"
       options="{'sent': 'fa fa-check', 'scheduled': 'fa fa-hourglass-half', 'running': 'fa fa-cogs', 'cancelled': 'fa fa-times-circle'}"/>

Four selection values, four icon classes, nothing else. The empty string plus nolabel triggers the 19-new 20px column width.

Reusing it on a custom status field

<field name="x_sync_status" widget="event_icon_selection" nolabel="1"
       options="{'ok': 'fa fa-check text-success', 'error': 'fa fa-exclamation-triangle text-danger', 'pending': 'fa fa-clock-o text-muted'}"/>

The class string is passed verbatim, so Bootstrap color utilities ride along with the icon class. The module is event, so the widget exists only on databases with Events installed.

Tooltips, crashes and the version plumbing

Three source details are worth knowing before you adopt it.

The tooltip ignores your labels. title is computed as the raw value with the first character upper-cased. For single-word values that reads fine, sent becomes Sent. For snake_case values it leaks the technical name: in_progress becomes In_progress. The selection's display label is never consulted, so pick presentable value keys or accept technical tooltips.

The empty-value crash. With no value, record.data[name] is false, and calling charAt on it throws a TypeError that takes the row's rendering down. Core avoids it because mail_state is a required selection with a default. On nullable fields, guard with an invisible condition or set a default.

Version drift is in the plumbing, not the behavior. Odoo 16 read the map from attrs.options and the value from the removed props.value API; 17 moved to record.data; 18 added the modern static props syntax and the listViewWidth hint of 20px for label-less columns, kept in 19. The icon map contract has been stable the whole way, until the Odoo 20 branch changes it, see below.

Version compatibility

VersionStatusNotes
Odoo 20.0Partial / changedNot released. The icon map format changes to [glyph, class] arrays; string maps break. See below.
Odoo 19.0VerifiedVerified against the shipped source; same contract as 18.
Odoo 18.0VerifiedAdds the 20px listViewWidth for label-less columns; map contract unchanged.
Odoo 17.0VerifiedInternal migration to record.data; same XML contract.
Odoo 16.0VerifiedWidget present with the same options-as-map contract.

Upgrade note. Views using string icon maps carry unchanged from 16 through 19. Plan a review for Odoo 20: the development branch rewrites the map values into two-element arrays, and 19-style strings will not resolve to icons there.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026; the development branch is not final until release.

On the branch, the widget joins the migration from Font Awesome to Odoo's new oi icon font, and that changes the options contract: each map value becomes a two-element array, ['error', 'oi-filled'] style, where the first entry is the data-icon glyph name and the second the class. The template renders oi plus the class with the glyph in data-icon. A 19-style string value would be indexed character by character, string index 0 is a single letter, so existing maps break rather than degrade. Core's own usage in the communication list is rewritten to the new format in the same commit. We re-verify at release.

Common problems and fixes

SymptomCause and fix
The row fails to render or the console shows charAt of falseThe field has no value; the tooltip getter calls charAt on false. Use the widget only on required or defaulted fields, or hide it with invisible="not my_field".
No icon shows for one specific valueThat value has no key in the options map; the lookup returns undefined and the <i> renders classless. Add the value as a key in the options dict with its icon class string.
Tooltip shows In_progress instead of the labelThe tooltip is the raw value capitalized; selection labels are never read. Expected; choose presentable value keys if tooltips matter, or add a help attribute on the column.
Widget missing on a database without EventsThe registration ships in the event module despite the generic-sounding behavior. Install Events, or copy the 30-line component into your own module under a new name.
Icons vanish after upgrading to Odoo 20The development branch changes map values from strings to [glyph, class] arrays for the oi font. Rewrite each map value in the new array format when migrating, mirroring the updated core usage.

Icon Selection widget vs the alternatives

WidgetBest forKey difference
event_icon_selectionCompact read-only status icons in dense lists, mapped from XMLThe options dict itself is the icon map; no named options, no editing, one icon per cell
state_selectionEditable three-state flags with a dropdownInteractive bullet with framework-managed colors, labels and autosave
event_state_selectionThe event kanban state with its cancel valueEditable state widget with hardcoded icons per state, event-specific
selection_badgeSelection values as clickable text badgesEditable badges showing labels rather than a single display icon
badgeRead-only colored text pills in listsShows the value's label with decoration colors instead of an icon

This widget is the right tool when the whole cell should be exactly one icon driven from XML. The moment you need editability, labels, or per-state colors managed by the framework, the selection family widgets below are the better fit.

Frequently asked questions

How do I configure the icons for event_icon_selection?+
Write the map straight into the field's options: options="{'sent': 'fa fa-check', 'cancelled': 'fa fa-times-circle'}". Each key is a possible field value, each value the icon's full class string. There are no other options.
Is event_icon_selection editable?+
No. It renders a single icon element in every mode and never writes the record. Pair it with a separate editable field if users must change the value.
Can I use event_icon_selection outside the Events app?+
Yes, on any model, as long as the event module is installed, since that is where the widget registers. It accepts char, text and selection fields.
Why does my list crash when the status field is empty?+
The tooltip getter capitalizes the raw value and calling charAt on an empty (false) value throws. Use the widget on required or defaulted fields, or add an invisible condition for empty values.
What happens to my icon map in Odoo 20?+
The development branch changes map values from class strings to two-element [glyph, class] arrays for the new oi icon font, and string maps stop resolving. Plan to rewrite the options dict during the 20 migration.

List views that read like dashboards?

We turn dense Odoo lists into scannable operational screens: status icons, exception highlighting and column design matched to how your team actually works a queue. Events, marketing and beyond, on Odoo 16 to 19.

Sharpen my list views

How this page was produced

This page was verified by reading icon_selection_field.js and its template in the Odoo 16.0, 17.0, 18.0 and 19.0 event module sources, the core usage in event_mail_views.xml, and the development-branch diff that introduces the array-based icon format. Report corrections via our contact page.