diff --git a/shopfloor_reception/actions/message.py b/shopfloor_reception/actions/message.py index bc23b19620b..60fe9556375 100644 --- a/shopfloor_reception/actions/message.py +++ b/shopfloor_reception/actions/message.py @@ -64,3 +64,13 @@ def lot_product_not_found(self, product_barcode): product_barcode=product_barcode, ), } + + def line_destination_set_success(self, move_line): + return { + "message_type": "success", + "body": _( + "Product '%(product)s' moved to '%(location)s'.", + product=move_line.product_id.display_name, + location=move_line.location_dest_id.display_name, + ), + } diff --git a/shopfloor_reception/services/reception.py b/shopfloor_reception/services/reception.py index 04ca03bc261..20a35e9a42f 100644 --- a/shopfloor_reception/services/reception.py +++ b/shopfloor_reception/services/reception.py @@ -1751,7 +1751,9 @@ def set_destination( message = self.msg_store.transfer_done_success(picking) return self._response_for_select_document(message=message) # Else return select move - return self._response_for_select_move(picking) + return self._response_for_select_move( + picking, message=self.msg_store.line_destination_set_success(selected_line) + ) def select_dest_package( self, picking_id, selected_line_id, barcode, confirmation=False diff --git a/shopfloor_reception/tests/test_select_move.py b/shopfloor_reception/tests/test_select_move.py index fb901c0b799..36335c0a8bf 100644 --- a/shopfloor_reception/tests/test_select_move.py +++ b/shopfloor_reception/tests/test_select_move.py @@ -121,6 +121,7 @@ def test_scan_product_partial(self): response, next_state="select_move", data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(selected_move_line), ) lines = picking.move_line_ids.filtered(lambda l: l.product_id == self.product_a) self.assertEqual(2, len(lines)) diff --git a/shopfloor_reception/tests/test_set_destination.py b/shopfloor_reception/tests/test_set_destination.py index ee63790aaa4..a36167fdfb5 100644 --- a/shopfloor_reception/tests/test_set_destination.py +++ b/shopfloor_reception/tests/test_set_destination.py @@ -62,7 +62,10 @@ def test_scan_location_child_of_dest_location(self): ) self.assertEqual(selected_move_line.location_dest_id, self.sub_input_location) self.assert_response( - response, next_state="select_move", data=self._data_for_select_move(picking) + response, + next_state="select_move", + data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(selected_move_line), ) def test_scan_location_valid_but_unexpected(self): @@ -102,7 +105,10 @@ def test_scan_location_valid_but_unexpected(self): ) self.assertEqual(selected_move_line.location_dest_id, self.sub_input_location_2) self.assert_response( - response, next_state="select_move", data=self._data_for_select_move(picking) + response, + next_state="select_move", + data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(selected_move_line), ) def test_scan_location_not_child_of_dest_locations(self): @@ -163,7 +169,10 @@ def test_auto_posting_partial(self): ) # Next screen is select move, because picking is not done self.assert_response( - response, next_state="select_move", data=self._data_for_select_move(picking) + response, + next_state="select_move", + data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(selected_move_line), ) # The line has been moved to a different picking. self.assertNotEqual(picking, selected_move_line.picking_id) @@ -241,7 +250,10 @@ def test_auto_posting_full_two_lines(self): }, ) self.assert_response( - response, next_state="select_move", data=self._data_for_select_move(picking) + response, + next_state="select_move", + data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(selected_move_line), ) # Lines has been moved in another picking self.assertNotEqual(picking, selected_move_line.picking_id) diff --git a/shopfloor_reception/tests/test_set_quantity.py b/shopfloor_reception/tests/test_set_quantity.py index f3022092875..3c492eb4007 100644 --- a/shopfloor_reception/tests/test_set_quantity.py +++ b/shopfloor_reception/tests/test_set_quantity.py @@ -877,7 +877,10 @@ def test_move_states(self): # When posted, the move line reserved_uom_qty has been set to qty_done self.assertEqual(move_line_user_2.qty_done, move_line_user_2.reserved_uom_qty) self.assert_response( - response, next_state="select_move", data=self._data_for_select_move(picking) + response, + next_state="select_move", + data=self._data_for_select_move(picking), + message=self.msg_store.line_destination_set_success(move_line_user_2), ) # Now, user1 can start working on this again service_user_1.dispatch(