OdooWiki OCA HUB

Sale Order Lot Generator

sale_order_lot_generator folder_open OCA/sale-workflow open_in_new
Sale License: AGPL-3

Generate automatically a lot number for each sale lines when you confirm a sale order.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Automatically creates a lot/serial number for sale order lines when the order is confirmed, for products flagged with 'Auto Generate Lot'. The lot number follows the pattern 'SO name-001'.

This module adds an 'Auto Generate Lot' checkbox on the product form, visible only when the product is tracked (not 'No Tracking'). When enabled, Odoo will automatically create a lot or serial number for that product on a sale order line.

  • On sale order confirmation, for each line whose product has 'Auto Generate Lot' checked, is tracked, and has no lot assigned yet, a new lot is created and linked to the line.
  • Lot numbers are built as the sale order name followed by a three-digit sequence, e.g. 'S00001-001', 'S00001-002', and so on.
  • The sequence continues from the highest existing number already used on that order, so numbers are not reused.
  • The same automatic creation also happens when a new sale order line is added to an order that is already confirmed (state 'sale').
  • The module extends product.template, sale.order and sale.order.line, and creates records in stock.lot.
  • It depends on sale_order_lot_selection, which provides the lot field on sale order lines.

No new menus or reports are added; the only visible change is the new checkbox on the product form.

Models and fields (3)
  • sale.order · extends an existing model
  • sale.order.line · extends an existing model
  • product.template · extends an existing modelauto_generate_prodlot (Auto Generate Lot)

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 5 confirmed, 4 with no information of 9 versions.

Sources · Odoo 12.0

Confirmed on 2026-11-03 in branch 12.0 of OCA/sale-workflow.

terminal Installation and usage

OCA documentation · Odoo 18.0

Go to product, inventory tab and check 'Auto Generate Lot' field.

Create a sale order with a product with 'Auto Generate Lot' field checked.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.