many2one_uom
The unit dropdown on order and move lines is many2one_uom: a many2one that knows which product the line carries and offers the units that make sense for it.
| Technical name | many2one_uom |
|---|---|
| Field types | many2one (uom.uom) |
| Views | form, list (order and move lines) |
| Module | uom (Units of Measure), installed with inventory and sales |
| Used in core | 69 occurrences across 11 modules, including stock, mrp, sale, product, mrp_subcontracting, account |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | Preset on core lines; applying it to custom fields is XML |
| Alternatives | many2one, timesheet_uom, radio |
What the many2one_uom widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
product_field | field name | Which many2one on the record carries the product that scopes the unit dropdown. On product template/variant forms the record itself is used, verified special case.(default: product_id) |
quantity_field | field name | Which field carries the line quantity passed to the unit autocomplete. Note the source declares availableTypes ["many2one"] for this option even though it names the quantity value; reported as found.(default: product_uom_qty) |
no_create | boolean | Inherited from the standard many2one: blocks creating units from the dropdown. Usually wise outside configuration screens. |
no_quick_create | boolean | Inherited: removes only the inline Create entry. |
no_create_edit | boolean | Inherited: removes only the Create and Edit popup entry. |
no_open | boolean | Inherited: controls the link to the unit record. |
search_threshold | number | Inherited: minimum characters before the search fires. |
placeholder_field | field name | Inherited: char field supplying a dynamic placeholder. |
A quirk worth knowing, verbatim from the source: quantity_field is declared with availableTypes: ["many2one"], although the value it names is the line's quantity (default product_uom_qty, a float). The option works as documented here; only the declared type in the panel metadata is off. We report it as we found it.
Working examples
A widget that announces its own retirement
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Options unchanged in the development branch; the internal override is still marked temporary. See below. |
| Odoo 19.0 | Verified | Verified against the shipped source and tested on a clean database. Part of 19's UoM rework. |
| Odoo 18.0 | Not available | The widget does not exist; unit fields use a plain many2one and packagings are a separate concept. |
| Odoo 17.0 | Not available | Not available. |
| Odoo 16.0 | Not available | Not available. |
Upgrade note. This widget is part of Odoo 19's unit-of-measure rework (packagings as relative units). On upgrade from 18 or earlier, line views that used plain many2one on unit fields still work but miss the product-aware dropdown; switching them to many2one_uom is a one-attribute change worth making during an Odoo migration.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Dropdown offers every unit in the system | The widget cannot find the product: the product_field default does not match your model. Set options="{'product_field': '...'}" to your product many2one. |
| Packaging entries missing from the dropdown | The product has no packaging units defined under the 19 UoM system. Define the pack as a unit with its relative factor on the product. |
| Widget name not found on Odoo 18 or earlier | The widget ships with the Odoo 19 UoM rework. Use a plain many2one on older versions, or upgrade. |
| Users created a bogus unit from an order line | Inherited quick-create is on by default. Add no_create: True on line views; manage units from configuration only. |
| A JavaScript patch on the widget broke after update | The internals are explicitly temporary per the source note. Re-implement at the options/domain level rather than patching component internals. |
Many2one_uom widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
many2one_uom | Unit fields on product-carrying lines | Product- and quantity-aware dropdown, packaging entries included |
many2one | Unit fields without product context | Standard dropdown, offers every unit the domain allows |
| timesheet_uom | Timesheet durations following company encoding | Different problem: dispatches time-entry widgets, unrelated to product units |
| radio | A tiny fixed set of units, all visible | Every option on screen, no search, no creation |
Frequently asked questions
What does the many2one_uom widget do differently from many2one?+
How do I use many2one_uom on a custom model?+
Why do I see a 12-pack in the unit dropdown?+
Does many2one_uom exist in Odoo 16, 17 or 18?+
Can I stop users creating new units from a line?+
Is it safe to customize this widget's JavaScript?+
Selling by the pack, stocking by the unit?
Odoo 19's new unit system is powerful and easy to misconfigure: reference units, pack factors and the views that expose them have to agree. We set up UoM, packagings and the sales-to-stock flow around them on Odoo 19.
Book a free consultation