Skip to content

Commit

Permalink
Merge PR OCA#742 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by jbaudoux
  • Loading branch information
OCA-git-bot committed Nov 27, 2023
2 parents c0b14f0 + 3965aca commit ed7c893
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 @@ -666,13 +666,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 @@ -717,10 +717,14 @@ 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.assertFalse(picking.move_line_ids.result_package_id)
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 ed7c893

Please sign in to comment.