Skip to content

Commit

Permalink
fixup! shopfloor_reception: Fix uom computation
Browse files Browse the repository at this point in the history
  • Loading branch information
TDu committed Oct 20, 2023
1 parent 5daa717 commit ef26342
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check warning on line 1277 in shopfloor_reception/services/reception.py

View check run for this annotation

Codecov / codecov/patch

shopfloor_reception/services/reception.py#L1277

Added line #L1277 was not covered by tests
split_move_vals = move._split(selected_line.qty_done)
new_move = move.create(split_move_vals)
new_move.move_line_ids = selected_line
Expand Down

0 comments on commit ef26342

Please sign in to comment.