mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add ability to search stock API
- serial number - part information
This commit is contained in:
parent
2e1388475e
commit
083bfe05c0
@ -440,6 +440,8 @@ class StockList(generics.ListCreateAPIView):
|
||||
|
||||
params = self.request.query_params
|
||||
|
||||
queryset = super().filter_queryset(queryset)
|
||||
|
||||
# Perform basic filtering:
|
||||
# Note: We do not let DRF filter here, it be slow AF
|
||||
|
||||
@ -680,6 +682,13 @@ class StockList(generics.ListCreateAPIView):
|
||||
filter_fields = [
|
||||
]
|
||||
|
||||
search_fields = [
|
||||
'serial',
|
||||
'part__name',
|
||||
'part__IPN',
|
||||
'part__description'
|
||||
]
|
||||
|
||||
|
||||
class StockAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user