mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-07 20:32:12 +00:00
Add stock item filtering by sub-category
This commit is contained in:
@@ -87,13 +87,12 @@ class PartList(generics.ListCreateAPIView):
|
||||
childs = category.getUniqueChildren()
|
||||
for child in childs:
|
||||
# Ignore the top-level category (already filtered)
|
||||
if child == cat_id:
|
||||
if str(child) == str(cat_id):
|
||||
continue
|
||||
flt |= Q(category=child)
|
||||
|
||||
parts_list = parts_list.filter(flt)
|
||||
|
||||
# Default - return all parts
|
||||
return parts_list
|
||||
|
||||
permission_classes = [
|
||||
|
Reference in New Issue
Block a user