Part allocation query improvements

This commit is contained in:
Oliver 2022-03-16 23:28:30 +11:00
parent c49cd52df7
commit 4a381c7474

View File

@ -1353,6 +1353,12 @@ class Part(MPTTModel):
line__order__status__in=SalesOrderStatus.OPEN,
shipment__shipment_date=None,
)
elif pending is False:
# Look only for 'closed' orders or orders which have shipped
queryset = queryset.exclude(
line__order__status__in=SalesOrderStatus.OPEN,
shipment__shipment_date=None,
)
return queryset