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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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