From 0f04956ffd625e804c45d15c244eac83232976cf Mon Sep 17 00:00:00 2001 From: "Suherdy SYC. Yacob" Date: Mon, 29 Sep 2025 11:49:30 +0700 Subject: [PATCH] add readme file --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7cc2dc7 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# Product Lot Sequence Per Product + +This module extends Odoo's lot and serial number generation to support unique sequences per product, aligning Odoo 18 with the behavior introduced in Odoo 19. + +## Features + +- **Per-Product Sequence Configuration**: Define a unique sequence for lot/serial number generation for each product. +- **Inventory Tab Integration**: Configure the custom sequence directly on the product form under the Inventory tab. +- **Automatic Generation**: Lot/serial numbers generated during incoming receipts and manufacturing orders follow the product-specific sequence. +- **Fallback Mechanism**: If no sequence is defined for a product, it falls back to the global lot/serial sequence. +- **UI Enhancements**: Avoids generation of invalid "0" lot numbers in manual and wizard flows. + +## Configuration + +1. Navigate to **Inventory > Products**. +2. Open or create a product. +3. Go to the **Inventory** tab. +4. Set the **Custom Lot/Serial** prefix to define a new sequence or select an existing sequence from the **Lot Sequence** field. +5. The **Next Number** field displays the next lot/serial number that will be generated. + +## Behavior + +- **Incoming Shipments**: When receiving products, if a product has a custom sequence, the generated lot/serial numbers will follow this sequence. +- **Manufacturing Orders**: When producing products, the finished lots/serials will be generated using the product's custom sequence. +- **Manual Creation**: Creating lots/serials manually or via "Generate Serials/Lots" will respect the product's sequence if configured. + +## Technical Details + +- The module adds a `lot_sequence_id` field to `product.template` to link the sequence. +- It overrides the `stock.lot` creation to use the product's sequence. +- It extends `stock.move` and `stock.move.line` to handle UI inputs and normalize "0" or empty inputs. +- It overrides `mrp.production._prepare_stock_lot_values` to ensure manufacturing flows use the product sequence. + +## Dependencies + +- `stock` +- `mrp` + +## Compatibility + +- Odoo 18 +- Requires `mrp` module for manufacturing order support \ No newline at end of file