boolean_update_flag
A checkbox that also answers a second question: did a human change this, or did the server? boolean_update_flag exists because an onchange cannot tell the difference.
| Technical name | boolean_update_flag |
|---|---|
| Field types | boolean |
| Views | form, list |
| Module | survey, but nothing in the widget is survey-specific |
| Used in core | 1 occurrence, the question time limit block in survey |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0 |
| No-code setup | No. It needs an options key and a context key that Studio cannot write |
| Alternatives | integer_update_flag, boolean, boolean_toggle |
What the boolean update-flag field does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
flagFieldName | string (options key, camelCase) | Technical name of the boolean field that receives the comparison result. Written exactly like this, in camelCase, and required: there is no fallback if it is missing or misspelled.(since Odoo 18.0) |
referenceValue | boolean (context key) | The value the checkbox is compared against, supplied through the field's context attribute rather than options. Any Python expression valid in the record's context works, including a field name. Required, and type-checked as a boolean.(since Odoo 18.0) |
The option key is camelCase. Almost every option in Odoo is snake_case; this one is written flagFieldName, exactly as it appears in the source, and flag_field_name is silently ignored. Both props are declared without the optional marker, which means a missing flagFieldName or a missing referenceValue is a props validation error rather than a quiet fallback.
Working examples
Eleven lines and one deliberate use of a private method
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Behavior identical on the development branch; only the Owl props syntax changes. |
| Odoo 19.0 | Verified | Verified against the shipped source. Byte-identical to Odoo 18. |
| Odoo 18.0 | Verified | First version. Same option key, same context key, same comparison. |
| Odoo 17.0 | Not available | Widget does not exist. |
| Odoo 16.0 | Not available | Widget does not exist. |
Upgrade note. The widget arrived in Odoo 18 and the Odoo 18 and Odoo 19 files are byte-identical, so views carry over untouched. On Odoo 17 and earlier the widget does not exist; a backport is straightforward, but the surrounding survey fields it was written for do not exist there either.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Props error mentioning flagFieldName | The option is missing or written in snake_case; only options.flagFieldName is read. Use options="{'flagFieldName': 'your_flag_field'}" with that exact spelling. |
| Props error mentioning referenceValue | No referenceValue in the field's context, or it evaluates to something that is not a boolean. Add context="{'referenceValue': some_boolean_field}" and make sure the expression yields True or False. |
| The flag never changes | The flag field is not loaded in the view, so the update has nothing to write to. Add the flag field to the view, invisible="True" is enough. |
| The flag is wrong after an import | The comparison only runs in the browser when a user clicks. Imports and API writes bypass it. Repeat the comparison in a server-side hook if imported data must carry a correct flag. |
| The flag was set by a recalculation | Something other than this widget wrote the flag field, most likely a compute or an automation rule. Check for other writers on that field; the widget itself never fires outside a user click. |
| The flag stays true after reverting the value | The revert happened through an onchange rather than a click, so the widget was not involved. Toggle the checkbox by hand to re-run the comparison, or clear the flag server side. |
Boolean update-flag field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
boolean_update_flag | Knowing that a person, not a compute, changed a checkbox | Writes a second boolean field with the result of comparing the new value to a reference value |
| integer_update_flag | The same override tracking on a numeric field | Listens to the input's change event instead of overriding onChange |
| boolean | An ordinary checkbox | Writes one field and knows nothing about defaults or overrides |
| boolean_toggle | A checkbox that should read as an on/off switch | Switch styling, still a single-field write |
Frequently asked questions
What does boolean_update_flag do that an onchange cannot?+
Why is the option key camelCase?+
Where does referenceValue come from?+
Does the flag update on import?+
Can I use it outside the survey app?+
Fighting a settings screen that overwrites people's work?
Global defaults with per-record overrides look simple and then quietly cause support tickets for a year. We design and build that override logic properly, in the browser and on the server, as part of Odoo customization work on 16 through 19.
Book a free consultation