sml_x2_many
The detailed operations list on a stock move. Its Add a line does not create an empty row: it opens the quants that actually hold the product, filtered to what is left after the lines you have already typed.
| Technical name | sml_x2_many |
|---|---|
| Field types | one2many, many2many |
| Views | form, with an embedded list |
| Module | stock, the Inventory app |
| Used in core | 1 occurrence, the detailed operations on a stock move in stock |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0 |
| No-code setup | No. It is tied to the stock move and quant models |
| Alternatives | one2many, pick_from, popover_widget, many2one_barcode |
What the move line list does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
show_quant | field on the move | Read literally. When false, the add action falls back to the standard behavior of creating an empty row, and none of the quant logic runs. |
default_location_id | context key | Read from the field's context. The quant selection is restricted to locations under it. |
editable | string (list attribute) | Set on the embedded list. Governs inline editing of the move lines themselves, independently of how they are added. |
Two view references are hardcoded. The quant selection dialog and the quant creation form are named literally in the source, so the dialog always uses Odoo's simplified quant list and form rather than anything you configure. The widget also exposes an internal switch, documented in the source as an extension point for subcontracting, that decides whether only on-hand quants are offered.
Working examples
Subtracting what you have typed but not saved
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Byte-identical to Odoo 19 on the development branch. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same quant selection and unsaved quantity handling. |
| Odoo 17.0 | Verified | First version. |
| Odoo 16.0 | Not available | Widget does not exist. Detailed operations were entered as plain rows. |
Upgrade note. No view change is needed between Odoo 17 and Odoo 19. The widget does not exist in Odoo 16, where detailed operations were entered as plain rows. Custom move views that replaced the move line field should adopt the widget to get quant-based picking.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Add a line creates an empty row instead of opening the dialog | The move's quant flag is false, which gates the whole behavior. Expected on operations where picking from stock does not apply. Check the flag if you believe it should. |
| The dialog offers no quants | There is no stock for the product under the source location, or the on-hand restriction excludes it. Check the product's on-hand quantities in that location branch. |
| The same stock is offered twice | The unsaved line quantities were not recomputed, usually because a customization bypassed the add handler. Add lines through the widget's own action rather than a custom button. |
| A quant I expected is missing | It is fully consumed by lines you have already entered but not saved. Expected. Save the lines to see the real remaining stock. |
| The dialog uses the wrong list view | The quant list and form views are named literally in the source. They cannot be changed from XML; extend the widget if a different view is required. |
| The selection ignores the location | The field's context does not carry the source location default. Supply it in the field's context, as the core move view does. |
Move line list vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
sml_x2_many | Recording what was actually picked, by choosing from real on-hand stock | Replaces the add action with a quant selection that accounts for lines you have typed but not saved |
| one2many | Move lines entered by hand | Adds an empty row with no knowledge of what stock exists |
| pick_from | Showing where a line was picked from | A display cell summarizing location, lot and package rather than a picker |
| popover_widget | Explaining a row's exception | Contextual notes rather than record creation |
| many2one_barcode | Scanning to select a record | A relation picker with scanning, not a quant selection |
Frequently asked questions
Why does Add a line open a dialog?+
Why is a quant missing from the list?+
When does it behave like a normal list?+
Can I change the views used in the dialog?+
Which versions have it?+
Stock figures your finance team can rely on
Accurate picking, lot tracking and the valuation that follows are one chain, and it breaks at data entry. We implement Odoo Inventory so what gets recorded matches what moved, on versions 16 through 19.
Book a free consultation