many2one_reference
The many2one_reference widget renders a reference field, where the target model lives in a second field, as an ordinary many2one picker. Leave that second field out of the view and it does not degrade: it throws.
September 18, 2026Updated September 18, 20264 min read
| Technical name | many2one_reference |
|---|---|
| Field types | many2one_reference |
| Views | form, list |
| Module | web, present in every Odoo database |
| Used in core | 1 explicit use in Odoo 19, in the data_cleaning Enterprise module. It also renders on every many2one_reference field with no widget attribute, through the registry type fallback. |
| Versions | Odoo 19.0, Odoo 20.0 |
| No-code setup | No. There is no Studio entry, and the field type itself is not something Studio creates. |
| Alternatives | reference, many2one_reference_integer, many2one |
What the many2one_reference widget does
What this means for your team
Working examples
Why a missing companion field throws instead of degrading
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 19.0 | Verified | Verified against the shipped 19.0 source. |
| Odoo 20.0 | Verified | Verified against the 20.0 branch. No usage changes. |
Unchanged between the two branches we checked.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The form does not render and the console shows 'model_field must be in view' | The companion model field named by the field's model_field is not present in the view. Add it to the view. It can carry invisible="1", it only has to be loaded. |
| The record picker is greyed out and will not accept input | No model has been chosen yet, so the widget forces readonly because there is nothing to search. Choose the model first. Put the model field above the record field in the layout so the order is obvious. |
| The picker searches the wrong model | The companion field holds a different model name than expected, often from a default or an onchange. Inspect the companion field's value on the record. The widget uses it verbatim as the relation. |
Many2one_reference widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
many2one_reference | A reference whose target model varies per record | Real many2one picker, but requires a companion model field in the view |
| reference | An occasional pointer with no companion field | Model and id stored together as text, so harder to query |
| many2one_reference_integer | Showing the raw id rather than the record name | Same field type, but renders the integer and never resolves the name |
| many2one | A relation to one fixed model | Model is set in the field definition, not at runtime |
Frequently asked questions
Why does my Odoo form break with 'model_field must be in view'?+
Why is my many2one_reference field readonly?+
Does many2one_reference have any options?+
What is the difference between many2one_reference and a reference field?+
Polymorphic links that break your forms?
Reference fields are where generic Odoo models get their flexibility, and where views quietly start throwing. We design the model and the view together so a record can point at anything without anyone seeing a blank screen.
Talk to an Odoo consultant