2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 02:25:38 +00:00

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.
This commit is contained in:
Jakob Haufe
2023-04-22 16:12:03 +02:00
committed by GitHub
parent 8df207d8e1
commit 7537fd1278

View File

@ -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'],
}