Enhance search and ordering fields across remaining REST API endpoints (#12737)

* Enhance search and ordering fields across remaining API endpoints

* Fix StockTrackingList search fields and bump API version to 537

* Format stock/api.py with ruff preview style

* Restore StockList.create serial validation handling to match upstream master

* Format files with ruff preview style and fix StockList try-except

* Restore StockList to match upstream master and keep stock/api.py diff minimal

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
Bhumin PaladiyaandMatthias Mair authored and GitHub committed 2026-10-18 09:23:59 +11:00
1 parent ddd460391e
commit 6d4e0f51c4
5 files changed
+13 -4

No files matched your search

@@ -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
+4
View File
@@ -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."""
+1 -1
View File
@@ -41,7 +41,7 @@ class MachineList(ListCreateAPI):
ordering = ['-active', 'machine_type']
search_fields = ['name']
search_fields = ['name', 'machine_type', 'driver']
class MachineDetail(RetrieveUpdateDestroyAPI):
+3
View File
@@ -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):
+1 -1
View File
@@ -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."""