import_lots
The button for the other source of numbers: paste the supplier's list rather than generating your own.
August 27, 2026Updated August 28, 20264 min read
| Technical name | import_lots |
|---|---|
| Views | form (view widget, <widget> element) |
| Module | stock, the Inventory app |
| Used in core | Stock move forms in stock |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. It is set in view XML and depends on module-specific data |
| Alternatives | generate_serials, sml_x2_many, many2one_barcode |
What the import lots does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
mode | prop passed to the dialog | Either generate or import. Decides the dialog's title and which inputs are shown. |
has_tracking | field read from the move | Lot or serial. Changes the title, the parsing and whether a total received field appears. |
the keep lines checkbox | control in the dialog | When unchecked, delete commands are issued for every existing line before the new ones are added. |
lot_sequence_id | field read from the product | Read when suggesting a starting number, then advanced through the sequence. |
The mode is the only difference. This widget passes import where its sibling passes generate, which changes the dialog's title and which inputs it shows. Everything after that is identical code.
Working examples
One dialog, two entry points
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Substantially reworked on the development branch. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same dialog and both registrations. |
| Odoo 17.0 | Verified | Same approach with older component conventions. |
| Odoo 16.0 | Verified | Same approach with older component conventions. |
Upgrade note. Present since Odoo 16, registered from the same file as its sibling. The two have never diverged, which is a deliberate consequence of sharing the dialog.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Existing lines disappeared | The keep lines checkbox was unchecked, so delete commands were issued first. Check the box to append instead of replace. |
| The next number is not from my sequence | The product has no lot sequence configured. Set one on the product; the widget reads it before suggesting a number. |
| Field change handlers did not fire | The lines are created directly from values to bypass them. Expected, and deliberate for performance. |
| The dialog title says lots not serials | The title follows the product's tracking type. Check the product's tracking setting. |
| A decimal count is rejected | Serial tracking parses the count as an integer. Expected. Lot tracking accepts decimals. |
| The unit of measure column is missing | The dialog checks a user group before showing it. Enable units of measure in settings. |
Import lots vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
import_lots | Pasting a supplier's list of lot or serial numbers onto a move | The shared dialog in import mode, writing lines directly into the relation |
generate_serials | Producing a run from your own sequence | The same dialog in generate mode |
sml_x2_many | Picking from existing stock | Selects quants rather than creating numbers |
| many2one_barcode | Scanning each unit | Accurate per unit, slower in bulk |
Frequently asked questions
How does this differ from generating?+
Why are the two registered from one file?+
Does pasting replace existing lines?+
Why are field change handlers skipped?+
Which versions have it?+
Receiving that keeps the paperwork honest
Supplier lot lists, barcodes and putaway rules all meet at the dock, and that is where traceability is won or lost. We implement Odoo Inventory receiving end to end, on versions 16 through 19.
Book a free consultation