Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/backend/InvenTree/InvenTree/api_version.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"""InvenTree API version information."""

# InvenTree API version
INVENTREE_API_VERSION = 541
INVENTREE_API_VERSION = 542
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""

INVENTREE_API_TEXT = """

v542 -> 2026-09-03 : https://github.com/inventree/InvenTree/pull/12737
- Adds search and ordering fields across remaining API endpoints (machine, stock, importer, report)

v541 -> 2026-09-03 : https://github.com/inventree/InvenTree/pull/12770
- Prevent DELETE operation against the /api/user/me/ endpoint

Expand Down
10 changes: 10 additions & 0 deletions src/backend/InvenTree/importer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ class DataImportSessionList(BulkDeleteMixin, DataImportSessionMixin, ListCreateA
filter_backends = SEARCH_ORDER_FILTER
filterset_fields = ['model_type', 'status', 'user']
ordering_fields = ['timestamp', 'status', 'model_type']
search_fields = [
'model_type',
'user__username',
'user__first_name',
'user__last_name',
]


class DataImportSessionDetail(DataImportSessionMixin, RetrieveUpdateDestroyAPI):
Expand Down Expand Up @@ -189,6 +195,10 @@ class DataImportColumnMappingList(DataImportSessionChildMixin, ListAPI):

filterset_fields = ['session']

ordering_fields = ['column_label', 'field_name', 'session']

search_fields = ['column_label', 'field_name']


class DataImportColumnMappingDetail(DataImportSessionChildMixin, RetrieveUpdateAPI):
"""Detail endpoint for a single DataImportColumnMap object."""
Expand Down
2 changes: 1 addition & 1 deletion src/backend/InvenTree/machine/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_serializer_class(self):

ordering = ['-active', 'machine_type']

search_fields = ['name']
search_fields = ['name', 'machine_type', 'driver']


class MachineDetail(RetrieveUpdateDestroyAPI):
Expand Down
3 changes: 3 additions & 0 deletions src/backend/InvenTree/report/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ class ReportAssetList(TemplatePermissionMixin, ListCreateAPI):

queryset = report.models.ReportAsset.objects.all()
serializer_class = report.serializers.ReportAssetSerializer
filter_backends = SEARCH_ORDER_FILTER
search_fields = ['description']
ordering_fields = ['description']


class ReportAssetDetail(TemplatePermissionMixin, RetrieveUpdateDestroyAPI):
Expand Down
12 changes: 10 additions & 2 deletions src/backend/InvenTree/stock/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class StockLocationTypeList(ListCreateAPI):

ordering = ['-location_count']

search_fields = ['name']
search_fields = ['name', 'description']

def get_queryset(self):
"""Override the queryset method to include location count."""
Expand Down Expand Up @@ -1717,7 +1717,15 @@ def list(self, request, *args, **kwargs):

ordering_fields = ['date']

search_fields = ['notes']
search_fields = [
'notes',
'user__username',
'user__first_name',
'user__last_name',
'part__name',
'part__IPN',
'item__serial',
]


stock_api_urls = [
Expand Down
Loading