| models | ||
| __init__.py | ||
| __manifest__.py | ||
| .gitignore | ||
| README.md | ||
MO Lock Consumed
This Odoo module customizes the behavior of Manufacturing Orders (MO) regarding ingredient consumption and validation.
Features
-
Lock Consumed Quantity:
-
Prevents the automatic update of a component's "Consumed" quantity when the MO's "Quantity to Produce" is changed, IF:
- The component already has a manually entered "Consumed" quantity (greater than 0).
-
If a component has 0 consumed quantity and is not picked, it will continue to scale automatically based on the BOM ratio (standard behavior).
-
-
Safety Check for Negative Stock:
- Hides the "Produce" and "Produce All" buttons if proceeding with the production would cause the potential stock of any component to drop below zero (negative stock).
- Exception: If a component's "Consumed" quantity is explicitly set to 0 (e.g., for custom productions where a BOM component is not used), it is skipped in this check, allowing production to proceed.
Usage
- Standard Flow: Create an MO, confirm it. The behavior remains standard unless you manually intervene.
- Custom Consumption: If you manually set a component's consumed quantity (e.g., to 5 units), changing the global "Quantity to Produce" will not override your manual entry of 5 units.
- Stock Validation: If you try to produce a quantity that requires more components than you have in stock, the Produce buttons will disappear, preventing you from accidentally forcing negative stock. To fix this, either replenish stock or adjust the consumed quantity to 0 (if omitting the component).