Skip to main content
iVentureTeam

boolean_checkbox

New in Odoo 20, and it exists because the plain boolean widget stopped being predictable: in Odoo 20 it renders as a toggle on small screens and a checkbox on desktop.

September 18, 2026Updated September 18, 20264 min read
Technical nameboolean_checkbox
Field typesboolean
Viewsform, list
Moduleweb, present in every Odoo 20 database
Used in core5 uses across Odoo 20 Community and Enterprise views, excluding tests. Does not exist in Odoo 19.
VersionsOdoo 20.0
No-code setupNo Studio entry of its own. It inherits the boolean widget's options.
Alternativesboolean, boolean_toggle, boolean_favorite, boolean_icon

What the boolean_checkbox widget does

The entire widget is this:

export class BooleanCheckboxField extends BooleanField {
    get displayAsToggle() {
        return false;
    }
}

export const booleanCheckboxField = {
    ...booleanField,
    component: BooleanCheckboxField,
};

One getter, hardcoded to false. The descriptor spreads the boolean descriptor so everything else is inherited.

That looks pointless until you read what the getter overrides, which is the reason this widget had to be created at all.

What this means for your team

A checkbox and a toggle mean subtly different things to users. A checkbox reads as a form field you fill in and then save. A toggle reads as a switch you flip and something happens.

In Odoo 20 the plain boolean widget picks between them based on screen size, which means the same field can read as a form field on a laptop and a switch on a tablet. Where the distinction carries meaning, that is a problem, and this widget is the fix.

It is worth deciding this deliberately on consent checkboxes, terms acceptance and anything an auditor might look at, where a checkbox affordance is what people expect to see.

Working examples

Forcing a checkbox regardless of screen size:

<field name="terms_accepted" widget="boolean_checkbox"/>

The three booleans in Odoo 20, side by side:

<!-- checkbox on desktop, toggle on small screens -->
<field name="flag"/>

<!-- always a checkbox -->
<field name="flag" widget="boolean_checkbox"/>

<!-- always a toggle -->
<field name="flag" widget="boolean_toggle"/>

The Odoo 20 change that made this widget necessary

In Odoo 19 the boolean widget had no opinion about screen size. Its component has no displayAsToggle getter at all, and it renders a checkbox everywhere.

Odoo 20 adds one:

get displayAsToggle() {
    return this.ui.isSmall;
}

So the base widget now decides at runtime. On a phone or a narrow window it renders a toggle, because a toggle is a larger and more forgiving touch target. On a desktop it stays a checkbox.

That is a sensible default and a genuine problem for a small number of fields. The affordance is not just decoration: a checkbox signals that the value is part of a form you will save, and a toggle signals an immediate switch. Any field where that distinction carries meaning, a consent box, a terms acceptance, anything in a compliance flow, should not change its meaning when somebody rotates a tablet.

boolean_checkbox overrides the getter to a constant false, which pins the rendering.

Worth noting what this does not do. It does not make the field save differently, and it does not restore anything removed elsewhere in Odoo 20. In particular boolean_toggle lost its autosave option in Odoo 20, along with every other widget in the field library, and this widget does not bring it back.

Version compatibility

VersionStatusNotes
Odoo 19.0Not availableDoes not exist, and is unnecessary: boolean is always a checkbox in Odoo 19.
Odoo 20.0VerifiedIntroduced in Odoo 20. Verified against the shipped 20.0 source.

This widget does not exist before Odoo 20, and it would have had nothing to do there.

What is changing in Odoo 20

Introduced in Odoo 20 as a direct response to the base boolean widget becoming screen-size aware in the same release.

Odoo 19 needed no such widget: boolean was always a checkbox and boolean_toggle was always a toggle. Odoo 20 makes that a three-way choice, where the default is now conditional.

The same release removed the autosave option from every widget in the web field library, which hit boolean_toggle and boolean_favorite among others. If you relied on that option to stop a toggle committing immediately, no boolean widget in Odoo 20 restores it.

Common problems and fixes

SymptomCause and fix
A checkbox turns into a toggle on a tabletThe base boolean widget returns a toggle when the interface reports a small screen. Use widget="boolean_checkbox" to pin the checkbox rendering.
The widget does not existIt is new in Odoo 20. On Odoo 19 the plain boolean widget is already always a checkbox, so nothing is needed.
autosave has no effect on any boolean widgetOdoo 20 removed the option from the entire web field library. There is no widget-level replacement. A toggle that must not commit immediately needs a custom widget.

Boolean_checkbox widget vs the alternatives

WidgetBest forKey difference
boolean_checkboxA boolean whose checkbox affordance carries meaningPins the checkbox rendering that Odoo 20 otherwise makes conditional on screen size
booleanMost boolean fieldsIn Odoo 20 it renders a toggle on small screens and a checkbox on desktop
boolean_toggleA field that genuinely is a switchAlways a toggle, and lost its autosave option in Odoo 20
boolean_favoriteA favorite or starred flagStar rendering rather than a box
boolean_iconA boolean shown as an iconIcon rather than a control

Leave the widget off entirely when you are happy with Odoo's responsive default, which is most fields. Use this one where the checkbox affordance carries meaning. Use boolean_toggle where the field genuinely is a switch, accepting that Odoo 20 no longer lets you stop it committing on click.

Frequently asked questions

Why does my Odoo 20 checkbox look like a toggle on mobile?+
Because the base boolean widget in Odoo 20 returns a toggle when the interface reports a small screen. Odoo 19 had no such behavior. Use widget="boolean_checkbox" to force a checkbox everywhere.
What is the difference between boolean, boolean_checkbox and boolean_toggle in Odoo 20?+
boolean is conditional: checkbox on desktop, toggle on small screens. boolean_checkbox is always a checkbox. boolean_toggle is always a toggle.
Does boolean_checkbox have options?+
None of its own. It spreads the boolean descriptor, so it inherits that widget's options and adds nothing. Its only job is to override one getter.
Can I stop a boolean toggle saving immediately in Odoo 20?+
Not with an option. The autosave option was removed from the entire web field library in Odoo 20, and no boolean widget restores it. That behavior now needs a custom widget.

Compliance fields that change shape on a tablet?

Odoo 20 makes the humble checkbox responsive, which is right almost everywhere and wrong on a consent box. We audit the fields where the affordance is part of the record and pin them before an auditor asks.

Talk to an Odoo consultant

How this page was produced

Verified by reading addons/web/static/src/views/fields/boolean_checkbox/boolean_checkbox_field.js on the 20.0 branch of a local clone of the official Odoo repository, quoted in full above. The base widget's new behavior comes from the displayAsToggle getter in views/fields/boolean/boolean_field.js on the same branch, and its absence in Odoo 19 was confirmed by reading the same file on the 19.0 branch. The autosave removal was confirmed by searching addons/web/static/src/views/fields/ in both trees. Corrections welcome via our contact page.