refactor: Remove 'picked' status as a condition for locking consumed quantity and bypassing quantity updates.
This commit is contained in:
parent
df7545fb99
commit
7b4130fc6c
@ -7,7 +7,7 @@ This Odoo module customizes the behavior of Manufacturing Orders (MO) regarding
|
|||||||
1. **Lock Consumed Quantity**:
|
1. **Lock Consumed Quantity**:
|
||||||
- Prevents the automatic update of a component's "Consumed" quantity when the MO's "Quantity to Produce" is changed, **IF**:
|
- 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).
|
- The component already has a manually entered "Consumed" quantity (greater than 0).
|
||||||
- OR the component has already been marked as picked.
|
|
||||||
- If a component has 0 consumed quantity and is not picked, it will continue to scale automatically based on the BOM ratio (standard behavior).
|
- If a component has 0 consumed quantity and is not picked, it will continue to scale automatically based on the BOM ratio (standard behavior).
|
||||||
|
|
||||||
2. **Safety Check for Negative Stock**:
|
2. **Safety Check for Negative Stock**:
|
||||||
|
|||||||
@ -9,6 +9,6 @@ class StockMove(models.Model):
|
|||||||
- The move already has a quantity set (partial consumption).
|
- The move already has a quantity set (partial consumption).
|
||||||
- The move is already picked.
|
- The move is already picked.
|
||||||
"""
|
"""
|
||||||
if self.quantity > 0 or self.picked:
|
if self.quantity > 0:
|
||||||
return True
|
return True
|
||||||
return super()._should_bypass_set_qty_producing()
|
return super()._should_bypass_set_qty_producing()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user