mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Add 'include self' option to getUniqueChildren
This commit is contained in:
@ -110,8 +110,7 @@ class PartList(generics.ListCreateAPIView):
|
||||
if cat_id:
|
||||
try:
|
||||
category = PartCategory.objects.get(pk=cat_id)
|
||||
cats = [category.id]
|
||||
cats += [cat for cat in category.getUniqueChildren()]
|
||||
cats = category.getUniqueChildren(include_self=True)
|
||||
parts_list = parts_list.filter(category__in=cats)
|
||||
except PartCategory.DoesNotExist:
|
||||
pass
|
||||
|
Reference in New Issue
Block a user