Do not try to assign shipments that do not need to be assigned
Closes #12311
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user