many2one_reference_integer
Where many2one_reference resolves a reference into a record picker, many2one_reference_integer does the opposite: it shows you the bare database id and nothing else.
September 18, 2026Updated September 18, 20263 min read
| Technical name | many2one_reference_integer |
|---|---|
| Field types | many2one_reference |
| Views | form, list |
| Module | web, present in every Odoo database |
| Used in core | 2 uses in Odoo 19, both in odoo/addons/base/views/ir_model_views.xml. Same count in Odoo 20. |
| Versions | Odoo 19.0, Odoo 20.0 |
| No-code setup | No. There is no Studio entry for this widget. |
| Alternatives | many2one_reference, integer, reference |
What the many2one_reference_integer widget does
What this means for your team
Working examples
The one advantage it has over many2one_reference
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 changes. |
Unchanged between the two branches we checked, including its usage count.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The field shows a number where users expect a record name | Working as designed. This widget deliberately shows the raw id. Switch to many2one_reference and add the companion model field to the view. |
| The field shows false or nothing | The reference is unset, so the getter returns false. Expected for an empty reference. Check the stored value if you believe it should be populated. |
| Integer widget options such as digits appear to be ignored | This widget defines its own descriptor rather than spreading the integer one, so it does not inherit integer's declared options. Do not rely on integer options here. If you need formatting, the value is a record id and probably should not be formatted at all. |
Many2one_reference_integer widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
many2one_reference_integer | Technical screens where the database id is the point | Shows the numeric id and never resolves the record name |
| many2one_reference | Letting users pick and read the actual record | Resolves the name, but requires a companion model field in the view |
| integer | An ordinary integer field | Cannot read the object shape a reference field arrives in |
| reference | A pointer stored as model and id in one column | Different field type entirely |
Frequently asked questions
How do I show a record's database ID in an Odoo view?+
Does many2one_reference_integer need the model field in the view?+
Does it have options?+
Technical screens your admins actually need?
Record ids, model configuration, reference plumbing: the screens that keep an Odoo database maintainable rarely come with the product. We build the admin and support views your team needs, without exposing them to everyone else.
Book a free consultation