mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +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