From 7537fd127892b1d0ca065c7066175f284a58e16c Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Sat, 22 Apr 2023 16:12:03 +0200 Subject: [PATCH] Fix sorting by location in stock item table (#4658) Currently, when sorting the stock item table by location, it gets sorted by location id. This changes the sorting criterion to pathstring. --- InvenTree/stock/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index b54f311142..61b3bbf832 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -1003,6 +1003,7 @@ class StockList(APIDownloadMixin, ListCreateDestroyAPIView): filter_backends = SEARCH_ORDER_FILTER_ALIAS ordering_field_aliases = { + 'location': 'location__pathstring', 'SKU': 'supplier_part__SKU', 'stock': ['quantity', 'serial_int', 'serial'], }