Fix for 'auto-allocate' stock to build orders

- Allocation of serialized stock items would cause issue
- Exclude serialized stock from auto allocation process
This commit is contained in:
Oliver 2022-04-26 15:54:03 +10:00
parent 2696f6bfbd
commit 85fd247878

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)