Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Accounting
  3. Lots & Serials in Invoice Lines v 17.0
  4. Sales Conditions FAQ

Lots & Serials in Invoice Lines

by Mohamed Yaseen Dahab https://www.speedy-world.com
Odoo
v 17.0 Third Party 229
Download for v 17.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
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
LicenseLGPL-3
Websitehttps://www.speedy-world.com
Versions 16.0 17.0
You bought this module and need support? Click here!
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
LicenseLGPL-3
Websitehttps://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.

Odoo 17.0 Accounting Sales & Purchase Lot Tracking Expiry Dates LGPL-3

๐Ÿ“‹ 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.

Screenshot Overview

โญ 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)
โ„น๏ธ
Automatic + Manual: For invoices generated from SO/PO, lots are computed automatically. For direct invoices, you can manually select lots. Both sources are combined if present.

๐Ÿ“ฅ 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
โš ๏ธ
Important: If you previously had 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.

๐Ÿ’ก
Tip: Manual lots and automatic lots are combined. If an invoice line is linked to a SO and you also add manual lots, both are displayed together.

๐Ÿ–จ๏ธ 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

Widget X
Lot/Serial: LOT-001, LOT-002 | Expiry: 2025-12-31, 2026-03-15 | Ref: BATCH-A

Each element only appears when data is present โ€” no empty labels are printed for products without lots or expiry dates.

Screenshot Overview

๐Ÿ› Bug Fixes & Improvements

This combined module fixes several issues present in the original separate modules:

  • โœ• Fixed: ref field no longer overrides the base payment reference field on invoice lines (renamed to lot_ref)
  • โœ• Fixed: Compute methods no longer return action dictionaries (separated into dedicated button methods)
  • โœ• Fixed: Variable scoping bug in popup actions (used self.lot_ids instead of leaked loop variable)
  • โœ• Fixed: PDF report uses safe inline injection instead of full tbody replacement
  • + Added: Proper @api.depends declarations on all compute methods
  • + Added: purchase_stock and product_expiry to 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:

WhatsApp +20 100 780 2335
Email mohamed.yaseen.dahab@gmail.com
๐Ÿ’ก
Upgrade command:
./odoo-bin -u lots_serials_in_invoice_lines -d your_database

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal โ€ข Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with