diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 1511b7a0d8..f7b577ccea 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -522,7 +522,10 @@ class Part(models.Model): Part may be stored in multiple locations """ - total = self.stock_entries.aggregate(total=Sum('quantity'))['total'] + if self.is_template: + total = sum([variant.total_stock for variant in self.variants.all()]) + else: + total = self.stock_entries.aggregate(total=Sum('quantity'))['total'] if total: return total