selection_badge_icons
The activity scheduling dialog in Odoo 19 picks the activity type from icon-labeled badges. That row of buttons is selection_badge_icons, a many2one-only twist on selection_badge.
| Technical name | selection_badge_icons |
|---|---|
| Field types | many2one |
| Views | form (activity dialogs) |
| Module | mail, shipped with every Odoo database |
| Used in core | 3 occurrences in the mail module, all on activity_type_id in activity dialogs |
| Versions | Odoo 19.0 |
| No-code setup | No. XML only; Studio does not expose this widget |
| Alternatives | selection_badge, radio, priority |
What the icon badges widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
iconField | attribute (camelCase) | Required. XML attribute naming the char field on the related model that stores each option's FontAwesome class. Omitting it fails props validation and breaks the view.(since Odoo 19.0) |
defaultIcon | attribute (camelCase) | Optional XML attribute. FontAwesome class used for options whose icon field is empty.(default: fa-check)(since Odoo 19.0) |
size | selection: sm, md, lg | Inherited from selection_badge. Renders the badges as small, medium or large buttons.(default: md) |
iconField is required. It is declared as a non-optional prop, so omitting the attribute does not fall back gracefully, it fails the OWL props validation and the dialog breaks. Always ship iconField with the widget, and remember both attributes are camelCase: iconField, defaultIcon, written as plain XML attributes, not inside options="{}".
Working examples
The name column, the fa prefix, and readonly
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Provisional: deleted on the development branch, replaced by badges_many2one with related_icon_field. See below. |
| Odoo 19.0 | Verified | Introduced in 19.0 with the redesigned activity dialog; verified against the shipped source. |
| Odoo 18.0 | Not available | Does not exist; the activity dialog used a plain selector. |
| Odoo 17.0 | Not available | Does not exist. |
| Odoo 16.0 | Not available | Does not exist. |
Upgrade note. New in Odoo 19; there is nothing to migrate from earlier versions. Views written against it will need attention at the Odoo 20 upgrade, see below.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Dialog crashes with a props validation error | The iconField attribute is missing; it is a required prop. Add iconField="icon" (or your icon column) to the field element. |
| Badges show but every icon is a check mark | The icon field is empty on those records, so defaultIcon (fa-check) kicks in. Fill the icon column with FontAwesome classes, or set defaultIcon to something meaningful. |
| Badges render with no label text | The related model has no real name column; the widget fetches name literally, not display_name. Add or populate a name field on the related model. |
| Icons never render for oi- style classes | The template hardcodes the fa prefix, so only FontAwesome classes work. Use fa-* icon names in the icon column. |
| Field shows plain text with no badges | The field is readonly; the readonly template drops the badge UI entirely. Expected behavior; make the field editable to get badges back. |
| Widget refuses a selection field | supportedTypes is many2one only, unlike the parent selection_badge. Use selection_badge for selection fields. |
Icon badges widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
selection_badge_icons | Short many2one choices picked constantly, like activity types | Icon-labeled badges fetched via search_read, many2one only |
| selection_badge | Text-only badges on selection or many2one fields | No icons, broader type support, same click behavior |
| radio | Choices that must look like a form, not buttons | Radio circles, optional horizontal layout, no icons |
| priority | Ranked levels like priority | Stars instead of badges, selection fields |
Frequently asked questions
What is the selection_badge_icons widget used for in Odoo 19?+
Why are iconField and defaultIcon not inside options?+
Can I use selection_badge_icons on a selection field?+
Where do the icons come from?+
Does it work with models that use display_name?+
Is selection_badge_icons available in Odoo 20?+
One-click pickers your users stop thinking about
We turn slow dropdowns into icon badge pickers where they earn their place, wire the icon columns behind them, and plan the rewrite to the Odoo 20 badges widgets before the upgrade forces it. UI polish in Odoo is cheap when someone has read the source first.
Improve my form UX