Skip to main content
iVentureTeam

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.

August 11, 2026Updated August 11, 20265 min read
Technical namemany2one_uom
Field typesmany2one (uom.uom)
Viewsform, list (order and move lines)
Moduleuom (Units of Measure), installed with inventory and sales
Used in core69 occurrences across 11 modules, including stock, mrp, sale, product, mrp_subcontracting, account
VersionsOdoo 20.0, Odoo 19.0
No-code setupPreset on core lines; applying it to custom fields is XML
Alternativesmany2one, timesheet_uom, radio

What the many2one_uom widget does

A plain many2one on a unit field would happily offer kilograms for a service or dozens for a liquid. This widget exists so that never happens: it is the standard many2one with its autocomplete swapped for a unit-aware one that knows the product on the line.

The wiring is visible in the source. The widget reads two sibling fields on the record, the product (default product_id) and the quantity (default product_uom_qty), resolves the product model, and hands all of it to the replacement autocomplete. When the record is a product (product template or variant forms), it uses the record itself as the product context.

Under Odoo 19's reworked unit system, where packagings became units carrying a relative factor to a reference unit, that context is what lets the dropdown offer entries like a 12-pack alongside Units for one product and only sensible units for another.

What this means for your team

Unit mistakes are expensive in a way most data errors are not: a purchase line in units that should have been cases is a real truck with the wrong quantity on it. The fix is not training people to be careful; it is a dropdown that only offers units that make sense for the product at hand, which is precisely this widget's job.

It matters double under Odoo 19's unit overhaul. Packagings are no longer a separate concept bolted onto lines; they are units with a factor, and this widget is where users meet them. Selling by the pack while stocking by the unit works out of the box when the dropdown understands the product; it becomes a support queue when a plain many2one lets any unit through.

If your business runs on hours and days instead of boxes, note the naming collision only: that widget handles time encoding and is unrelated to this one.

Supported options in Odoo 19

Verified against many2one_uom_field.js in the Odoo 19.0 uom module. Two own options plus the inherited standard many2one set (the widget builds on buildM2OFieldDescription and spreads m2oSupportedOptions).

OptionTypeWhat it does
product_fieldfield nameWhich 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_fieldfield nameWhich 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_createbooleanInherited from the standard many2one: blocks creating units from the dropdown. Usually wise outside configuration screens.
no_quick_createbooleanInherited: removes only the inline Create entry.
no_create_editbooleanInherited: removes only the Create and Edit popup entry.
no_openbooleanInherited: controls the link to the unit record.
search_thresholdnumberInherited: minimum characters before the search fires.
placeholder_fieldfield nameInherited: 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

How core order lines use it

<field name="product_uom_id" widget="many2one_uom"/>

Defaults do the work: the widget finds product_id and product_uom_qty on the same line.

Custom line model with different field names

<field name="uom_id" widget="many2one_uom"
       options="{'product_field': 'item_id', 'quantity_field': 'qty'}"/>

Point the two options at your model's product and quantity fields and the unit dropdown becomes product-aware on your custom lines too.

Locked to existing units

<field name="product_uom_id" widget="many2one_uom"
       options="{'no_create': True}"/>

The inherited many2one options apply unchanged; here creation is blocked so typos cannot mint new units, usually the right call outside the configuration screens.

A widget that announces its own retirement

Two source details are worth carrying into any customization built on this widget.

The override is explicitly temporary. The file opens with a developer note: the autocomplete extension "will be removed in the future when the autocomplete source generation come from a hook". The widget name and options are the stable contract; the internal component layout is not. JavaScript patches on UomMany2One internals are the kind of customization that dies at the next major version, so keep any behavior change at the options/domain level if you possibly can.

Product resolution has a special case. On most models the product comes from product_field, but when the record itself is a product.template or product.product, the source uses the record's own id as the product. That is why the same widget works on product forms without any options, and why a custom wrapper model around products may need explicit options where core forms need none.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Options unchanged in the development branch; the internal override is still marked temporary. See below.
Odoo 19.0VerifiedVerified against the shipped source and tested on a clean database. Part of 19's UoM rework.
Odoo 18.0Not availableThe widget does not exist; unit fields use a plain many2one and packagings are a separate concept.
Odoo 17.0Not availableNot available.
Odoo 16.0Not availableNot 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

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

Options and registration are unchanged: the same two own options over the same inherited set. The temporary-override note still stands in the development branch, so the promised hook-based replacement has not landed yet; when it does, XML stays stable while JavaScript patches on the internals break. We re-verify once Odoo 20 ships.

Common problems and fixes

SymptomCause and fix
Dropdown offers every unit in the systemThe 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 dropdownThe 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 earlierThe 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 lineInherited 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 updateThe 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

WidgetBest forKey difference
many2one_uomUnit fields on product-carrying linesProduct- and quantity-aware dropdown, packaging entries included
many2oneUnit fields without product contextStandard dropdown, offers every unit the domain allows
timesheet_uomTimesheet durations following company encodingDifferent problem: dispatches time-entry widgets, unrelated to product units
radioA tiny fixed set of units, all visibleEvery option on screen, no search, no creation

The practical test: unit fields on product-carrying lines get this widget. Unit fields with no product context, a bare configuration table, are a plain many2one. And time-encoding on timesheets is timesheet_uom, a different widget for a different problem that happens to share three letters.

Frequently asked questions

What does the many2one_uom widget do differently from many2one?+
It replaces the autocomplete with a unit-aware one that reads the line's product (and quantity) and offers the units that fit, including packaging units under Odoo 19's reworked UoM system. Everything else, options included, is the standard many2one.
How do I use many2one_uom on a custom model?+
Apply the widget to your uom many2one and point its options at your fields: options="{'product_field': 'item_id', 'quantity_field': 'qty'}". Defaults are product_id and product_uom_qty, so core-like models need no options at all.
Why do I see a 12-pack in the unit dropdown?+
Odoo 19 models packagings as units with a relative factor, and this widget surfaces them for the product on the line. Selecting the pack sells or moves in that grouping while stock keeps counting reference units.
Does many2one_uom exist in Odoo 16, 17 or 18?+
No. It ships with Odoo 19's unit-of-measure rework. Earlier versions render unit fields with the plain many2one and handle packagings separately.
Can I stop users creating new units from a line?+
Yes, the standard inherited options apply: options="{'no_create': True}" removes creation from the dropdown, which is usually right anywhere outside unit configuration screens.
Is it safe to customize this widget's JavaScript?+
Carefully: the source itself says the autocomplete override "will be removed in the future". Treat the widget name and options as the stable surface and keep customizations at that level; internal patches are scheduled to break.

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

How this page was produced

The options, the defaults, the product-model special case, the availableTypes quirk and the temporary-override note were all read from the Odoo 19.0 uom module source (many2one_uom_field.js) and confirmed on a clean Odoo 19 database, where the screenshot was captured. The Odoo 20 statement comes from the same file on the public development branch. Spotted an error? Tell us and we will correct the page.