mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Prevent BOM price calculation from becoming too recursive
This commit is contained in:
		| @@ -824,6 +824,11 @@ class Part(models.Model): | |||||||
|         max_price = None |         max_price = None | ||||||
|  |  | ||||||
|         for item in self.bom_items.all().select_related('sub_part'): |         for item in self.bom_items.all().select_related('sub_part'): | ||||||
|  |  | ||||||
|  |             if item.sub_part.pk == self.pk: | ||||||
|  |                 print("Warning: Item contains itself in BOM") | ||||||
|  |                 continue | ||||||
|  |  | ||||||
|             prices = item.sub_part.get_price_range(quantity * item.quantity) |             prices = item.sub_part.get_price_range(quantity * item.quantity) | ||||||
|  |  | ||||||
|             if prices is None: |             if prices is None: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user