diff --git a/modules/stock/shipment.py b/modules/stock/shipment.py index 22034a576f..5059391c20 100644 --- a/modules/stock/shipment.py +++ b/modules/stock/shipment.py @@ -961,6 +961,7 @@ class ShipmentInReturn(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): def assign_try(cls, shipments, with_childs=None): pool = Pool() Move = pool.get('stock.move') + shipments = [s for s in shipments if s.state == 'waiting'] to_assign = defaultdict(list) for shipment in shipments: location_type = shipment.from_location.type @@ -1704,6 +1705,10 @@ class ShipmentOut(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): @ModelView.button def assign_try(cls, shipments): Move = Pool().get('stock.move') + shipments = [ + s for s in shipments + if s.state == 'waiting' + and s.warehouse_storage != s.warehouse_output] to_assign = [ m for s in shipments for m in s.assign_moves if m.assignation_required]