From 0497035030654c07bc826419404207a9d781381a Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Mon, 1 Sep 2025 13:44:11 +0200 Subject: [PATCH] [IMP] shopfloor: Allow to use picking type destination --- shopfloor/services/service.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/shopfloor/services/service.py b/shopfloor/services/service.py index 09600a066ca..cc6c92750f9 100644 --- a/shopfloor/services/service.py +++ b/shopfloor/services/service.py @@ -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 @@ -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