selection_badge_with_filter
In Odoo 19 this widget shows a selection as badges filtered by another field's value. In Odoo 20 the same registration name belongs to a completely different widget, so the same XML does something else.
| Technical name | selection_badge_with_filter |
|---|---|
| Field types | selection |
| Views | form |
| Module | web in Odoo 19. In Odoo 20 the same name is registered by hr_holidays instead. |
| Used in core | 1 use in Odoo 19, on the state field in odoo/addons/base/views/ir_actions_views.xml. That field uses badges_selection in Odoo 20. |
| Versions | Odoo 19.0, Odoo 20.0 |
| No-code setup | No. There is no Studio entry, and the required option is not exposed anywhere. |
| Alternatives | selection_badge, statusbar, selection, radio |
What the selection_badge_with_filter widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
allowed_selection_field | field name | <strong>Required, and not declared in supportedOptions.</strong> Names another field on the record holding the list of selection keys to show. The component declares the matching prop as a non-optional String, so omitting it fails prop validation. The named field must be present in the view. |
size | selection | Badge size, one of sm, md or lg. Inherited from the selection_badge descriptor rather than declared here. Odoo's own view used sm, and dropped it when migrating to badges_selection in Odoo 20.(default: md) |
allowed_selection_field does not appear in supportedOptions, so Studio will never offer it and no options helper will suggest it. It is read in extractProps and required by the component. This is the single most important thing to know about this widget, and it is documented nowhere in Odoo.
Working examples
The same widget name means something else in Odoo 20
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 19.0 | Verified | Generic filtering widget in the web module. Verified against the shipped 19.0 source. |
| Odoo 20.0 | Renamed / replaced | Name reused by an unrelated hr_holidays widget. Migrate to badges_selection. |
This is a rename in the worst direction: the name survives and the meaning does not.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Prop validation fails and the field does not render | allowed_selection_field was not provided. The component declares it as a non-optional String. Add options="{'allowed_selection_field': 'your_field'}" and make sure that field is in the view. |
| No badges render at all | The companion field is empty or not loaded, so the filter matches nothing. Add the companion field to the view, invisible if needed, and check its computed value. |
| After upgrading to Odoo 20 the filtering stopped working | The registration name now belongs to an hr_holidays widget that ignores allowed_selection_field. Switch to widget="badges_selection", which reads the same option. Drop the size option, as Odoo did. |
| After upgrading, the field renders as a plain selection | hr_holidays is not installed, so the Odoo 20 registration does not exist and Odoo falls back to the field type. Switch to badges_selection. Do not install hr_holidays to get the widget back; it is not the same widget. |
Selection_badge_with_filter widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
selection_badge_with_filter | Showing only the legal next values of a status field | Filters by another field, via an option Odoo never declares |
| selection_badge | Badges with no filtering | Shows every value in the selection |
| statusbar | A pipeline shown across the top of a form | Different layout, and filtering is done with statusbar_visible |
| selection | A plain dropdown | No badges, and filtering needs a domain or dynamic selection |
| radio | A short list shown as radio buttons | All values visible at once, no filtering |
Frequently asked questions
How do I show only some values of an Odoo selection field as badges?+
Why does selection_badge_with_filter fail to render?+
Does selection_badge_with_filter still work in Odoo 20?+
What replaced selection_badge_with_filter in Odoo 20?+
Upgrading to Odoo 20 with custom widgets in your views?
This widget keeps its name and changes its meaning, which is the kind of break no upgrade script catches and no error message announces. We diff your views against the 20.0 branch and hand you the list of what silently changes.
Get an upgrade audit