Skip to content
Open
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
16 changes: 12 additions & 4 deletions shopfloor/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def is_src_location_valid(self, location):
"""
return location.is_sublocation_of(self.picking_types.default_location_src_id)

def is_dest_location_valid(self, moves, location):
def is_dest_location_valid(self, moves, location, pick_type=False):
"""Check the destination location is valid for given moves.

We ensure the destination is either valid regarding the picking
Expand All @@ -143,9 +143,17 @@ def is_dest_location_valid(self, moves, location):
condition and not anymore this one that has a destination to an
intermediate location)
"""
return location.is_sublocation_of(
moves.picking_id.location_dest_id, func=all
) or location.is_sublocation_of(moves.location_dest_id, func=all)
return (
location.is_sublocation_of(moves.picking_id.location_dest_id, func=all)
or location.is_sublocation_of(moves.location_dest_id, func=all)
or (
location.is_sublocation_of(
moves.picking_type_id.default_location_dest_id, func=all
)
if pick_type
else False
)
)

def is_dest_location_to_confirm(self, location_dest_id, location):
"""Check the destination location requires confirmation
Expand Down