mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-20 23:15:10 +00:00
Add filtering for parts which have an IPN set
This commit is contained in:
1 parent
c4cae02170
commit
a952dc38a3
2 files changed
+16
No files matched your search
@@ -430,6 +430,17 @@ class PartList(generics.ListCreateAPIView):
|
||||
except (ValueError, Part.DoesNotExist):
|
||||
pass
|
||||
|
||||
# Filter by whether the part has an IPN (internal part number) defined
|
||||
has_ipn = params.get('has_ipn', None)
|
||||
|
||||
if has_ipn is not None:
|
||||
has_ipn = str2bool(has_ipn)
|
||||
|
||||
if has_ipn:
|
||||
queryset = queryset.exclude(IPN='')
|
||||
else:
|
||||
queryset = queryset.filter(IPN='')
|
||||
|
||||
# Filter by whether the BOM has been validated (or not)
|
||||
bom_valid = params.get('bom_valid', None)
|
||||
|
||||
|
||||
Reference in new issue
Block a user