Merge pull request #2873 from SchrodingersGat/build-auto-allocate-fix

Fix for 'auto-allocate' stock to build orders
This commit is contained in:
Oliver 2022-04-26 16:24:34 +10:00 committed by GitHub
commit c743ededf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -871,6 +871,9 @@ class Build(MPTTModel, ReferenceIndexingMixin):
part__in=[p for p in available_parts],
)
# Filter out "serialized" stock items, these cannot be auto-allocated
available_stock = available_stock.filter(Q(serial=None) | Q(serial=''))
if location:
# Filter only stock items located "below" the specified location
sublocations = location.get_descendants(include_self=True)