mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
Distinct query fix (#5916)
* Fix "allocated" query for stock items * Use distinct() elsewhere * Add unit test to check distinct query results
This commit is contained in:
@ -1012,7 +1012,7 @@ class Build(MPTTModel, InvenTree.mixins.DiffMixin, InvenTree.models.InvenTreeBar
|
||||
)
|
||||
|
||||
# Filter out "serialized" stock items, these cannot be auto-allocated
|
||||
available_stock = available_stock.filter(Q(serial=None) | Q(serial=''))
|
||||
available_stock = available_stock.filter(Q(serial=None) | Q(serial='')).distinct()
|
||||
|
||||
if location:
|
||||
# Filter only stock items located "below" the specified location
|
||||
|
Reference in New Issue
Block a user