📋 Description
An intelligent inventory management enhancement that allows warehouse staff to select specific stock quants (lot + location combinations) directly when registering scrap operations. This eliminates guesswork and manual data entry errors in multi-location warehouses.
🎯 Business Challenge
Van Thiel operates a complex warehouse environment with multiple storage locations and lot-tracked products. The standard Odoo scrap process required staff to manually select lots and locations separately, leading to:
- Time wasted searching through dropdown lists of similar lot numbers
- Errors when scrapping from the wrong location
- Confusion about which quants were reserved for pending orders
- No visibility into available vs. reserved quantities per quant
💡 Solution Approach
Matthias developed a quant-based selection system that integrates seamlessly into Odoo's scrap workflow:
- Quant Picker Interface: Custom view showing lot, location, on-hand qty, reserved qty, and available qty in one glance
- Auto-fill Logic: When a quant is selected, the lot and location fields populate automatically via
@api.onchangehooks - Smart Synchronization: Both create() and write() methods ensure data consistency between quant selection and lot assignment
- Context-Aware Filtering: The quant list dynamically filters based on the selected product and location
🔧 Technical Implementation
The module extends stock.scrap with a Many2one relation to stock.quant.
Key technical features include:
- Dedicated picker views (
stock_quant_picker.xml) with restricted create/edit options - Computed field
reservation_sourcesshows which orders have reserved each quant - Onchange methods keep lot_id synchronized with quant_id selection
- Override of create() and write() methods ensures data integrity at the database level
📊 Results & Impact
This solution reduced scrap registration time by ~60% and eliminated location selection errors completely. Warehouse staff can now make informed decisions about which quants to scrap based on reservation status.