diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index b5f424848c..7469e45007 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,12 +1,14 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 559 - +INVENTREE_API_VERSION = 560 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v560 -> 2026-10-17 : https://github.com/inventree/InvenTree/pull/12737 + - Adds search and ordering fields across remaining API endpoints (machine, stock, importer, report) + v559 -> 2026-10-17 : https://github.com/inventree/InvenTree/pull/13023 - Enforce maximum length for "notes" field in stock-adjustment API endpoints diff --git a/src/backend/InvenTree/importer/api.py b/src/backend/InvenTree/importer/api.py index fd8c6024fd..763ed99a50 100644 --- a/src/backend/InvenTree/importer/api.py +++ b/src/backend/InvenTree/importer/api.py @@ -189,6 +189,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.""" diff --git a/src/backend/InvenTree/machine/api.py b/src/backend/InvenTree/machine/api.py index 48c8d6bf6d..e03fe6a58a 100644 --- a/src/backend/InvenTree/machine/api.py +++ b/src/backend/InvenTree/machine/api.py @@ -41,7 +41,7 @@ class MachineList(ListCreateAPI): ordering = ['-active', 'machine_type'] - search_fields = ['name'] + search_fields = ['name', 'machine_type', 'driver'] class MachineDetail(RetrieveUpdateDestroyAPI): diff --git a/src/backend/InvenTree/report/api.py b/src/backend/InvenTree/report/api.py index deb5acc5e0..2f83cc5272 100644 --- a/src/backend/InvenTree/report/api.py +++ b/src/backend/InvenTree/report/api.py @@ -373,6 +373,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): diff --git a/src/backend/InvenTree/stock/api.py b/src/backend/InvenTree/stock/api.py index 62fb20630c..7625190774 100644 --- a/src/backend/InvenTree/stock/api.py +++ b/src/backend/InvenTree/stock/api.py @@ -559,7 +559,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."""