Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] shopfloor: Improve message for location content transfer items #925

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions shopfloor/actions/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,14 @@ def transfer_complete(self, picking):
"body": _("Transfer {} complete").format(picking.name),
}

def location_content_transfer_item_complete(self, location_dest):
def location_content_transfer_item_complete(self, location_src, location_dest):
return {
"message_type": "success",
"body": _("Content transfer to {} completed").format(location_dest.name),
"body": _(
"Content line transferred from %(location_name)s to %(location_dest_name)s",
location_name=location_src.name,
location_dest_name=location_dest.name,
),
}

def location_content_transfer_complete(self, location_src, location_dest):
Expand Down
4 changes: 2 additions & 2 deletions shopfloor/services/location_content_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def set_destination_package(
stock.validate_moves(package_moves)
move_lines = self._find_transfer_move_lines(location)
message = self.msg_store.location_content_transfer_item_complete(
scanned_location
location, scanned_location
)
completion_info = self._actions_for("completion.info")
completion_info_popup = completion_info.popup(package_moves.move_line_ids)
Expand Down Expand Up @@ -778,7 +778,7 @@ def set_destination_line(
else:
move_lines = self._find_transfer_move_lines(move_line.location_id)
message = self.msg_store.location_content_transfer_item_complete(
scanned_location
location, scanned_location
)
completion_info = self._actions_for("completion.info")
completion_info_popup = completion_info.popup(move_line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_set_destination_package_dest_location_ok(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)
for move in package_level.move_line_ids.mapped("move_id"):
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_set_destination_package_dest_location_ok_with_completion_info(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
popup=completion_info_popup,
)
Expand Down Expand Up @@ -385,7 +385,7 @@ def test_set_destination_line_dest_location_ok(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)

Expand Down Expand Up @@ -436,7 +436,7 @@ def test_set_destination_line_dest_location_ok_with_completion_info(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
popup=completion_info_popup,
)
Expand Down Expand Up @@ -485,7 +485,7 @@ def test_set_destination_line_partial_qty(self):
response,
done_picking.backorder_ids,
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)
self.assertEqual(move_line_c.move_id.state, "done")
Expand Down Expand Up @@ -754,7 +754,7 @@ def test_set_destination_package_split_move(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)

Expand Down Expand Up @@ -812,7 +812,7 @@ def test_set_destination_line_split_move(self):
response,
move_lines.mapped("picking_id"),
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)
# Process the other move lines (lines w/o package + package levels)
Expand Down Expand Up @@ -1047,7 +1047,7 @@ def test_set_destination_lines_partial_qty_next_line(self):
response,
backorder,
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)
# check that the next operation has the appropriate attributes
Expand All @@ -1071,6 +1071,6 @@ def test_set_destination_lines_partial_qty_next_line(self):
response,
self.picking,
message=self.service.msg_store.location_content_transfer_item_complete(
self.dest_location
self.content_loc, self.dest_location
),
)
Loading