mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Tweak the 'on_order' calculation
This commit is contained in:
		| @@ -327,7 +327,7 @@ class SupplierPart(models.Model): | ||||
|         if q is None or r is None: | ||||
|             return 0 | ||||
|         else: | ||||
|             return q - r | ||||
|             return max(q-r, 0) | ||||
|      | ||||
|  | ||||
|     def purchase_orders(self): | ||||
|   | ||||
| @@ -809,7 +809,7 @@ class Part(models.Model): | ||||
|     def on_order(self): | ||||
|         """ Return the total number of items on order for this part. """ | ||||
|  | ||||
|         return sum([part.on_order() for part in self.supplier_parts.all()]) | ||||
|         return sum([part.on_order() for part in self.supplier_parts.all().prefetch_related('purchase_order_line_items')]) | ||||
|  | ||||
|  | ||||
| def attach_file(instance, filename): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user