2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-12 07:54:14 +00:00

Rename field part.has_variants to part.is_template

This commit is contained in:
Oliver Walters
2019-05-25 23:58:31 +10:00
parent c3d75deb16
commit c45a506a10
12 changed files with 95 additions and 14 deletions

View File

@ -274,7 +274,7 @@ class StockList(generics.ListCreateAPIView):
part = Part.objects.get(pk=part_id)
# If the part is a Template part, select stock items for any "variant" parts under that template
if part.has_variants:
if part.is_template:
stock_list = stock_list.filter(part__in=[part.id for part in Part.objects.filter(variant_of=part_id)])
else:
stock_list = stock_list.filter(part=part_id)