Skip to content

Commit

Permalink
[FIX] sf_single_product_transfer
Browse files Browse the repository at this point in the history
Remove user from backorder
  • Loading branch information
jbaudoux committed Sep 9, 2023
1 parent b5737be commit fd5815f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,15 @@ def _split_move(self, move_line):
# backorder, which should not be the case.
# See if there's a way to identify the moves
# generated through this mechanism and avoid creating them.
move_line._split_partial_quantity()
new_move_line = move_line._split_partial_quantity()
new_move = move_line.move_id.split_other_move_lines(
move_line, intersection=True
)
if new_move:
# A new move is created in case of partial quantity
new_move.extract_and_action_done()
stock = self._actions_for("stock")
stock.unmark_move_line_as_picked(new_move_line)
return
# In case of full quantity, post the initial move
move_line.move_id.extract_and_action_done()
Expand Down
4 changes: 4 additions & 0 deletions shopfloor_single_product_transfer/tests/test_set_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,13 @@ def test_set_quantity_scan_location(self):
)
self.assertEqual(backorder.move_line_ids.qty_done, 6.0)
self.assertEqual(backorder.move_line_ids.state, "done")
self.assertEqual(backorder.user_id, self.env.user)
self.assertEqual(backorder.move_line_ids.shopfloor_user_id, self.env.user)
self.assertEqual(picking.move_line_ids.product_uom_qty, 4.0)
self.assertEqual(picking.move_line_ids.qty_done, 0.0)
self.assertEqual(picking.move_line_ids.state, "assigned")
self.assertEqual(picking.user_id.id, False)
self.assertEqual(picking.move_line_ids.shopfloor_user_id.id, False)

def test_set_quantity_scan_location_allow_move_create(self):
self.menu.sudo().allow_move_create = True
Expand Down

0 comments on commit fd5815f

Please sign in to comment.