mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-19 22:47:48 +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:
1 parent
5be6bc8940
commit
fe0d9c1923
6 files changed
+119
-16
No files matched your search
@@ -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