selection_badge
When every option should be visible and one click away, selection_badge replaces the dropdown with a row of pills. It also hides three behaviors nobody expects: a self-clearing click, a text-only readonly mode, and a full reload of many2one options.
| Studio name | Badges |
|---|---|
| Technical name | selection_badge |
| Field types | selection, many2one |
| Views | form, list (list.selection_badge variant) |
| Also registered as | list.selection_badge (adds color_field); sibling widget selection_badge_with_filter in the same module |
| Module | web, present in every Odoo database |
| Used in core | 17 occurrences across 8 modules, including hr_skills, hr_recruitment_skills, mail, calendar, marketing_card, crm |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0 |
| No-code setup | Yes for selection fields, via Odoo Studio (Enterprise); many2one usage is XML only |
| Alternatives | radio, badge, label_selection, priority |
What the Selection Badge widget does
What this means for your team
Setting it up in Odoo Studio (no code)
What Studio cannot do here
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
size | selection | Pill size: sm, md or lg, mapped to Bootstrap button size classes in edit mode. Default md.(default: md)(since Odoo 19.0) |
color_field | field name | <strong>Only on the list.selection_badge variant.</strong> Integer field holding a color index 0 to 11; readonly list rows render the badge in that color. Ignored on forms.(since Odoo 19.0) |
color_field only exists on the list variant, and only acts in readonly rows, where it colors the badge from an integer field using the standard 0 to 11 palette. In editable list rows the widget falls back to the normal pill row. On forms the option is silently ignored.
Working examples
Three behaviors that generate support tickets
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Replaced by badges_selection and badges_many2one on the development branch; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source, including both registered variants. |
| Odoo 18.0 | Partial / changed | Core pill behavior only: no size, no color_field, no list variant, no with_filter sibling. Verified against the 18.0 source. |
Upgrading from Odoo 18? The core pill behavior is unchanged, but everything around it is new in 19.0: the size option, the list.selection_badge variant with color_field, and the selection_badge_with_filter sibling all have no 18.0 equivalent.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Saved form shows plain text instead of pills | Readonly rendering is text by design; pills exist only in edit mode. Use badge or label_selection if you want a styled state display in readonly. |
| Value disappears after clicking | Clicking the active pill clears a non-required field. Expected behavior. Make the field required to prevent empty values, and mention the shortcut in training. |
| Form is slow and covered in pills | The field is a many2one over a large model; every matching record was fetched as a pill. Tighten the field's domain or switch to a normal many2one; the widget is intended for small option sets. |
| color_field does nothing | The option lives on the list variant only and acts only in readonly rows. Use it in list views; on forms combine the field with the badge widget instead. |
| Pills wrap over several lines | Too many options or labels too long for the container width. Shorten labels, reduce options, or accept the dropdown of the plain selection widget. |
Selection Badge widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
selection_badge | Small option sets switched frequently | Every option is a visible pill; click active to clear; text-only in readonly |
| radio | All options visible, arranged vertically | Radio buttons with labels, horizontal option available, no clear-on-reclick |
| badge | Readonly state display with decoration colors | Display-only widget; never editable |
| label_selection | Colored status labels in list views | Display-only, colors mapped per value via the classes option |
| priority | Selections that mean a scale | Stars instead of pills, saves on click |
Frequently asked questions
How do I show a selection as buttons in Odoo?+
Why does clicking the selected pill empty the field?+
Why do pills disappear when the record is saved?+
Can I use it on many2one fields?+
How do I get colored badges in a list view?+
What is selection_badge_with_filter?+
Are your forms fighting your users?
Widget choice is UX strategy in miniature: pills for fast switching, stars for scales, badges for state. We redesign Odoo screens field by field, the right widget, the right defaults, the right required flags, until data entry stops being the slowest part of your process.
Book a free consultation