Skip to content

Commit

Permalink
[FIX] mrp: allow to consume less than expected
Browse files Browse the repository at this point in the history
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#144718

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
  • Loading branch information
ajf-odoo committed Apr 18, 2024
1 parent bbd8e1d commit b742b79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/mrp/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ def _get_relevant_state_among_moves(self):
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

0 comments on commit b742b79

Please sign in to comment.