diff --git a/shopfloor_reception/services/reception.py b/shopfloor_reception/services/reception.py index bc8d0819217..07dcbca4f39 100644 --- a/shopfloor_reception/services/reception.py +++ b/shopfloor_reception/services/reception.py @@ -1264,14 +1264,17 @@ def _post_shopfloor_created_line(self, selected_line): def _auto_post_line(self, selected_line): # If user only processed 1/5 and is the only one working on the move, # then selected_line is the only one related to this move. - # In such case, we must ensure there's another move line with the remaining + # In such case, we must ensure there's another move with the remaining # quantity to do, so selected_line is extracted in a new move as expected. if selected_line.product_uom_qty: selected_line.product_uom_qty = 0 move = selected_line.move_id - if selected_line.qty_done == move.product_uom_qty: + move_quantity = move.product_uom._compute_quantity( + move.product_uom_qty, selected_line.product_uom_id + ) + if selected_line.qty_done == move_quantity: # In case of full quantity, post the initial move - selected_line.move_id.extract_and_action_done() + return selected_line.move_id.extract_and_action_done() split_move_vals = move._split(selected_line.qty_done) new_move = move.create(split_move_vals) new_move.move_line_ids = selected_line