diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 8405afd972..79445fd02d 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -824,6 +824,11 @@ class Part(models.Model): max_price = None 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) if prices is None: