Skip to main content
iVentureTeam

import_lots

The button for the other source of numbers: paste the supplier's list rather than generating your own.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 28, 20264 min read
Technical nameimport_lots
Viewsform (view widget, <widget> element)
Modulestock, the Inventory app
Used in coreStock move forms in stock
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. It is set in view XML and depends on module-specific data
Alternativesgenerate_serials, sml_x2_many, many2one_barcode

What the import lots does

Receiving a hundred tracked units means a hundred move lines, each with its own number. Typing them is not a realistic option, so Odoo offers two ways to fill them: generate a run of numbers, or paste a list you already have.

Both go through the same dialog, and both of these widgets are the buttons that open it. They differ only in the mode they pass, which decides the dialog's title and which controls it shows.

The generated or pasted lines are then pushed into the move's line relation directly, deliberately bypassing the usual field change handlers.

What this means for your team

Serial and lot tracking is a compliance requirement in food, pharmaceuticals and regulated manufacturing, and an operational one anywhere returns and recalls matter. The reason it fails in practice is data entry volume at receipt.

These two paths cover the two realistic sources of numbers: your own sequence, or the supplier's list from a packing slip. Deciding which of the two your process uses is worth doing before go live, because the warehouse workflow differs.

Supported options in Odoo 19

The widget itself takes the standard view widget props and declares no options. The controls listed below belong to the shared dialog. Read from the generate serial source, Odoo 19.0.

OptionTypeWhat it does
modeprop passed to the dialogEither generate or import. Decides the dialog's title and which inputs are shown.
has_trackingfield read from the moveLot or serial. Changes the title, the parsing and whether a total received field appears.
the keep lines checkboxcontrol in the dialogWhen unchecked, delete commands are issued for every existing line before the new ones are added.
lot_sequence_idfield read from the productRead 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

Placing it

<widget name="import_lots"/>

No attributes. It passes the move and the import mode.

What you paste

# one number per line, from a packing slip

Read from the dialog's text input.

The generate path instead

<widget name="generate_serials"/>

Same dialog, producing a run from your sequence.

One dialog, two entry points

The dialog is where everything happens, and the part worth understanding is how it writes the lines.

It calls a server method to build the line values, passing the product, both locations, the tracking type and the quantity, plus the mode and whichever inputs that mode uses. What comes back is a list of value dictionaries.

Then, rather than adding records through the normal path, it creates data points directly from those values and pushes them into the relation's internal record list, command list and identifier list by hand. The source says why: to bypass the field change handlers. On a hundred lines those handlers would fire a hundred times.

A checkbox decides whether existing lines survive. When it is unchecked the dialog issues delete commands for every current identifier before adding the new ones, which is what makes a second generation replace rather than append.

One asymmetry worth knowing: for lot tracking the count and quantity are read as decimals and a total received field is offered, while for serial tracking the count is read as an integer and the quantity comes from the move. That follows from what the two tracking modes mean.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Substantially reworked on the development branch.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame dialog and both registrations.
Odoo 17.0VerifiedSame approach with older component conventions.
Odoo 16.0VerifiedSame 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

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this may still change; we re-verify this page after the release.

Substantially reworked. The development branch rewrites the shared file with a large diff. Both buttons and the shared dialog are what to expect to survive.

Common problems and fixes

SymptomCause and fix
Existing lines disappearedThe 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 sequenceThe product has no lot sequence configured. Set one on the product; the widget reads it before suggesting a number.
Field change handlers did not fireThe lines are created directly from values to bypass them. Expected, and deliberate for performance.
The dialog title says lots not serialsThe title follows the product's tracking type. Check the product's tracking setting.
A decimal count is rejectedSerial tracking parses the count as an integer. Expected. Lot tracking accepts decimals.
The unit of measure column is missingThe dialog checks a user group before showing it. Enable units of measure in settings.

Import lots vs the alternatives

WidgetBest forKey difference
import_lotsPasting a supplier's list of lot or serial numbers onto a moveThe shared dialog in import mode, writing lines directly into the relation
generate_serialsProducing a run from your own sequenceThe same dialog in generate mode
sml_x2_manyPicking from existing stockSelects quants rather than creating numbers
many2one_barcodeScanning each unitAccurate per unit, slower in bulk

The generate path is the sibling to reach for when the numbers are yours rather than the supplier's. Scanning each unit is the third option and the most accurate, at the cost of time at the dock.

Frequently asked questions

How does this differ from generating?+
Only in the mode passed to the shared dialog, which changes the title and which inputs appear. The line writing is identical code.
Why are the two registered from one file?+
So they cannot diverge. Both are thin components that open the same dialog with a different mode.
Does pasting replace existing lines?+
Only if the keep lines checkbox is unchecked, in which case delete commands are issued for every existing line first.
Why are field change handlers skipped?+
The dialog creates data points directly from the server-returned values, which the source notes is deliberate to avoid firing handlers once per line.
Which versions have it?+
Odoo 16 onwards. The development branch reworks the shared file substantially.

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

How this page was produced

The two registrations sharing one file, the mode passed to the dialog, the direct data point creation bypassing field change handlers, the delete commands issued when existing lines are not kept and the decimal versus integer parsing by tracking type were read from the generate serial source on the Odoo 19.0 branch. Version coverage comes from comparing the file across the 16.0, 17.0 and 18.0 branches and against the public development branch. Spotted an error? Tell us and we will correct the page.