From c8c6a6af5ff1f09e1e66fbd902b6c7248e35c5a4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 1 Feb 2026 22:01:31 +1100 Subject: [PATCH] [API] Allow sorting of test results by start/finish time (#11232) * [API] Allow sorting of test results by start/finish time - Bring API in line with UI expectation * Bump API version * Allow ordering by "test_station" field --------- Co-authored-by: Matthias Mair --- src/backend/InvenTree/InvenTree/api_version.py | 6 +++++- src/backend/InvenTree/stock/api.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index 0f25bc724e..fc63d601dd 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,15 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 445 +INVENTREE_API_VERSION = 446 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v446 -> 2026-02-01 : https://github.com/inventree/InvenTree/pull/11232 + - Allow ordering of test results by started_datetime and finished_datetime fields + - Allow ordering of test results by test_station field + v445 -> 2026-01-29 : https://github.com/inventree/InvenTree/pull/11102 - Added "allocated_lines" field to SalesOrderSerializer to track fully allocated line items diff --git a/src/backend/InvenTree/stock/api.py b/src/backend/InvenTree/stock/api.py index 84f21b55d1..baa1be9b38 100644 --- a/src/backend/InvenTree/stock/api.py +++ b/src/backend/InvenTree/stock/api.py @@ -1452,7 +1452,13 @@ class StockItemTestResultList( output_options = StockItemTestResultOutputOptions filterset_fields = ['user', 'template', 'result', 'value'] - ordering_fields = ['date', 'result'] + ordering_fields = [ + 'date', + 'result', + 'started_datetime', + 'finished_datetime', + 'test_station', + ] ordering = 'date'