[FIX] mrp: allow to consume less than expected
In Shop Floor, consuming less tracked by lots components than expected gives an 'Invalid Operation: lot/serial number needs to be specified for a tracked product' error. Discarding the dialog to fix the quantities makes the production order disappear from the Shop Floor. This because of the MO Readiness filter: as the move becomes partially available, the reservation state goes to confirmed rather than assigned. closes odoo/odoo#144718 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -619,6 +619,8 @@ class StockMove(models.Model):
|
||||
res = super()._get_relevant_state_among_moves()
|
||||
if res == 'partially_available'\
|
||||
and self.raw_material_production_id\
|
||||
and all(move.should_consume_qty and float_compare(move.quantity, move.should_consume_qty, precision_rounding=move.product_uom.rounding) >= 0 for move in self):
|
||||
and all(move.should_consume_qty and float_compare(move.quantity, move.should_consume_qty, precision_rounding=move.product_uom.rounding) >= 0
|
||||
or (float_compare(move.quantity, move.product_uom_qty, precision_rounding=move.product_uom.rounding) >= 0 or (move.manual_consumption and move.picked))
|
||||
for move in self):
|
||||
res = 'assigned'
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user