| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Inventory (stock) • Purchase (purchase) |
| Lines of code | 253 |
| Technical Name |
lots_serials_in_invoice_lines |
| License | LGPL-3 |
| Website | https://www.speedy-world.com |
| Versions | 16.0 17.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Inventory (stock) • Purchase (purchase) |
| Lines of code | 253 |
| Technical Name |
lots_serials_in_invoice_lines |
| License | LGPL-3 |
| Website | https://www.speedy-world.com |
| Versions | 16.0 17.0 |
๐ท๏ธ Lots & Serials in Invoice Lines
Track Lot/Serial Numbers and Expiry Dates across Sale Orders, Purchase Orders, Invoices, and PDF Reports โ with full traceability from order to invoice.
๐ Overview
Lots & Serials in Invoice Lines brings lot/serial number and expiry date visibility to every stage of your sales and purchasing workflow. Lot information flows automatically from stock moves to Sale Order lines, Purchase Order lines, and Invoice lines โ and is printed on the Invoice PDF report.
The module also supports manual lot selection for direct invoices that are not linked to any Sale Order or Purchase Order, ensuring complete lot traceability even when orders are created directly.
Each order/invoice line includes a popup button that opens a detailed view of all associated lots with their names, references, and expiry dates.
โญ Key Features
- โ Sale Order Lines: Lot/Serial tags computed from delivery stock moves, with popup browser
- โ Purchase Order Lines: Lot/Serial tags computed from receipt stock moves, with popup browser
- โ Invoice Lines: Lots, expiry dates, and lot references displayed as computed columns
- โ Manual Lot Selection: For direct invoices not linked to SO/PO, manually pick lots from available stock
- โ Invoice PDF Report: Lot/serial and expiry info printed below each product line on the PDF
- โ Lot Reference: Internal lot reference shown alongside lot name and expiry
- โ Popup Browser: Click the list icon on any line to open a detailed tree view of lots with expiry dates
- โ Cross-Channel: Works with customer invoices (from sales) and vendor bills (from purchases)
- โ Non-Intrusive: Products without lot tracking behave exactly as before โ zero disruption
- โ Community & Enterprise: Works on both Odoo 17 editions
โก How It Works
Lot information is computed automatically from stock moves โ no manual data entry required for orders linked to deliveries or receipts.
|
๐ฆ
Delivery / Receipt Lots assigned in stock moves |
โ |
๐
SO / PO Lines Lots appear as tags |
โ |
๐งพ
Invoice Lines Lots + expiry displayed |
โ |
๐จ๏ธ
PDF Report Printed on invoice PDF |
Where Lots Come From
| Source | Lot Lookup Path |
|---|---|
| Sale Order โ Invoice | sale.order.line
โ stock.move
โ stock.lot
|
| Purchase Order โ Bill | purchase.order.line
โ stock.move
โ stock.lot
|
| Direct Invoice | Manual selection via manual_lot_ids
field (domain-filtered to the product)
|
๐ฅ Installation
Requirements
| Requirement | Details |
|---|---|
| Odoo Version | 17.0 (Community & Enterprise) |
| Depends On |
account,
sale_stock,
purchase_stock,
product_expiry
|
| Python Libraries | None |
| License | LGPL-3 |
lots_serials_in_invoice_lines
or
lot_expiry_invoice
installed, uninstall both before installing this combined module
to avoid XML ID conflicts.
Steps
| 1 | Upload the
module Copy the lots_serials_in_invoice_lines
folder into your addons directory.
|
| 2 | Update app
list Go to Apps โ Update Apps List |
| 3 | Install the
module Search for "Lots & Serials in Invoice Lines" and click Install. |
๐ Usage: Sale Orders & Purchase Orders
After deliveries or receipts are processed with lots, the lot information appears automatically on the order lines.
| 1 | Create a Sale Order or Purchase Order with lot-tracked products. |
| 2 | Process the delivery (SO) or receipt (PO) and assign lot/serial numbers to the stock moves. |
| 3 | Return to the order โ the Lots / Serials column now shows tags with the assigned lot numbers. |
| 4 | Click the ๐ list icon on any line to open a popup showing lot names, references, and expiry dates. |
๐งพ Usage: Invoices & Vendor Bills
Invoices from SO/PO (Automatic)
When you create an invoice from a Sale Order or a vendor bill from a Purchase Order, the lot and expiry information is computed automatically โ no action needed.
| Column | Description | Default |
|---|---|---|
| Lot/Serial | Comma-separated lot/serial names | Shown |
| Expiry Date | Comma-separated expiry dates (YYYY-MM-DD) | Shown |
| Lot Ref | Internal lot references | Hidden (optional) |
| ๐ Button | Opens popup with full lot detail tree view | Always |
Direct Invoices (Manual Lots)
For invoices created directly (not from an SO/PO), you can manually select lots using the Lots (Manual) field. This field is domain-filtered to show only lots belonging to the product on that line.
๐จ๏ธ Invoice PDF Report
The module extends the standard Odoo invoice PDF template to show lot and expiry information below each product line. The information appears as small, muted text beneath the product description, keeping the report clean and professional.
What's Printed
Each element only appears when data is present โ no empty labels are printed for products without lots or expiry dates.
๐ Bug Fixes & Improvements
This combined module fixes several issues present in the original separate modules:
- โ Fixed:
reffield no longer overrides the base payment reference field on invoice lines (renamed tolot_ref) - โ Fixed: Compute methods no longer return action dictionaries (separated into dedicated button methods)
- โ Fixed:
Variable scoping bug in popup actions (used
self.lot_idsinstead of leaked loop variable) - โ Fixed: PDF report uses safe inline injection instead of full tbody replacement
- + Added: Proper
@api.dependsdeclarations on all compute methods - + Added:
purchase_stockandproduct_expiryto dependencies - + Added: Lot reference display in PDF report
โ Frequently Asked Questions
Why are lots not appearing on my invoice lines?
Lots are computed from stock moves. Make sure the delivery (for sales) or receipt (for purchases) has been validated with lots assigned. Draft transfers don't create lot links.
Can I manually add lots to an invoice from a Sale Order?
Yes. The Lots (Manual) field is available on all invoice lines. Manual lots are combined with automatically computed lots from SO/PO deliveries.
What if my product doesn't have expiry dates?
No problem. The expiry date column will simply be empty for lots without expiration. The lot name is still displayed. Enable the product_expiry module and configure expiry dates on your lots if needed.
Does this affect the invoice PDF layout?
The lot/expiry info is added as small text below the product description โ no extra columns are added to the PDF table. The layout stays clean and compatible with other report customizations.
I previously had two separate modules installed. How do I migrate?
Uninstall both lots_serials_in_invoice_lines
and
lot_expiry_invoice,
then install this combined module.
Manual lot data stored in the old manual_lot_ids
M2M table will need
to be re-entered since the relation table name has changed for safety.
๐ค Support
For questions, bug reports, or feature requests:
./odoo-bin
-u lots_serials_in_invoice_lines -d your_database
Please log in to comment on this module