| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) |
| Lines of code | 45 |
| Technical Name |
stock_expiry_block |
| License | LGPL-3 |
| Website | https://github.com/haythamafify/custom_addons |
Block Expired Lots on Receipt
Automatically prevent validation of vendor receipts containing expired lots or serial numbers.
Protect your inventory โ before it's too late.
โ Key Features
|
โ
Hard Block on Validation
Users cannot confirm a receipt if any lot/serial number has an expired date. No workarounds. |
๐
Detailed Error Message
Shows exactly which lot, product, and expiry field triggered the block โ clear and actionable. |
|
๐
Checks All 3 Expiry Fields
Expiration Date, Best Before Date (use_date), and Removal Date โ all covered. |
๐ฏ
Incoming Receipts Only
Only affects vendor receipts. Internal transfers and deliveries are not impacted. |
โ๏ธ How It Works
User clicks Validate on an incoming receipt (vendor shipment).
Module scans all move lines and checks expiry dates on stock.move.line first.
Falls back to stock.production.lot dates if move line has no dates set.
If expired โ raises UserError listing all affected lots, products, and dates. Receipt is blocked.
๐ญ Perfect For
๐ง Technical Details
| Property | Value |
| Odoo Version | 18.0 |
| Dependencies | stock, product_expiry |
| Model Overridden | stock.picking |
| Method Overridden | button_validate |
| License | LGPL-3 |
| Author | Haytham Afify |
๐ฅ Installation
Steps
1. Place stock_expiry_block in your custom addons path.
2. Update the Apps list in Odoo.
3. Search for Block Expired Lots on Receipt and install.
Please log in to comment on this module