| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Barcode (stock_barcode)
• Inventory (stock) • Discuss (mail) |
| Lines of code | 92 |
| Technical Name |
stock_barcode_free_serial_location |
| License | LGPL-3 |
| Website | https://sjr.ie |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Barcode (stock_barcode)
• Inventory (stock) • Discuss (mail) |
| Lines of code | 92 |
| Technical Name |
stock_barcode_free_serial_location |
| License | LGPL-3 |
| Website | https://sjr.ie |
Stock Barcode - Free Serial Location Pick
When using the Odoo Barcode app for picking operations with serial-tracked products, Odoo reserves stock from a specific source location (e.g. LocA). If an operator physically picks the item from a different location (e.g. LocB), Odoo does not update the source location on the move line, resulting in:
- Negative stock (-1) at the physically-picked location (LocB)
- Phantom stock (+1) remaining at the reserved location (LocA)
This module eliminates that friction. It automatically corrects source locations at validation time and enforces reserved quantities in real time during scanning — preventing both stock integrity issues and over-picking, for all product tracking types.
Features
- Auto-corrects source location for serial-tracked move lines at validation time — operators never need to manually override the source location
- Smart serial line matching — when a serial is scanned, the barcode model finds the most appropriate unstarted reserved line rather than always creating a new one, preserving reservation integrity
- Reserved quantity enforcement — prevents scanning more units than reserved for any product type (serial, lot, or untracked), with an immediate in-app danger notification
- No extra steps required from warehouse operators — fully transparent to users
- No UI changes — works silently in the background
- Safe fallback: skips lines where the serial cannot be found in stock; Odoo's standard validation error surfaces these naturally
Installation
-
Copy the
stock_barcode_free_serial_locationfolder to your Odoo addons directory. - Update the apps list in Odoo (Settings > Apps > Update Apps List).
- Search for "Stock Barcode - Free Serial Location Pick" and install it.
Dependency: Requires the stock_barcode
module (standard Odoo Barcode app).
Configuration
No configuration is required. The module works automatically for all picking operations once installed.
Usage
Warehouse operators use the Barcode app exactly as before:
- 1Open a picking in the Barcode app.
- 2Scan any serial number — regardless of which location Odoo originally reserved it from.
- 3If you attempt to scan more units than the picking has reserved for a product, a danger notification is shown immediately and the scan is blocked.
- 4Press Validate.
At validation, the module queries stock.quant to find
where each scanned serial has positive stock and updates the move
line's source location before Odoo records the stock move.
Technical Notes
The module operates across two layers:
Python (server-side)
-
stock.move.line.fix_serial_source_location()— queriesstock.quantfor the actual positive internal quant of each serial and updateslocation_idif it differs from the reserved location. -
stock.picking.button_validate()— collects all done serial-tracked lines and calls the helper before delegating to the standard validation flow.
JavaScript (client-side)
-
BarcodePickingModel.createNewLine()(patch) — for serial-tracked products, finds an unstarted reserved line for that product and redirects toupdateLine()on it instead of creating a new one. For all product types, checks whether the totalqty_donewould exceed the totalreserved_uom_qty; if so, shows a danger notification and aborts the scan. -
BarcodePickingModel.updateLine()(patch) — for all product types, checks whether the incomingqty_donevalue would push the total done quantity over the total reserved. If so, shows a danger notification and aborts the update. This covers subsequent scans of the same product where an existing line is incremented rather than a new one created.
Edge Cases
| Scenario | Behaviour |
|---|---|
| Serial in transit on another picking | Quant still shows original location; source location corrected to that location. |
| Serial does not exist in stock | Quant query returns nothing; location unchanged — standard Odoo error raised on validate. |
| Scan exceeds reserved quantity | Danger notification shown immediately; scan blocked for all product types (serial, lot, untracked). |
| Lot / untracked products | Source location fix skipped at validation; reserved quantity guard still applies during scanning. |
| Source location already correct | No write performed. |
| Product has no reservation | Quantity guard not applied — no reserved qty to enforce against. |
Credits
Authors
- SJR Nebula
Contributors
- John Ashurst
Please log in to comment on this module