mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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:
parent
8df207d8e1
commit
7537fd1278
@ -1003,6 +1003,7 @@ class StockList(APIDownloadMixin, ListCreateDestroyAPIView):
|
|||||||
filter_backends = SEARCH_ORDER_FILTER_ALIAS
|
filter_backends = SEARCH_ORDER_FILTER_ALIAS
|
||||||
|
|
||||||
ordering_field_aliases = {
|
ordering_field_aliases = {
|
||||||
|
'location': 'location__pathstring',
|
||||||
'SKU': 'supplier_part__SKU',
|
'SKU': 'supplier_part__SKU',
|
||||||
'stock': ['quantity', 'serial_int', 'serial'],
|
'stock': ['quantity', 'serial_int', 'serial'],
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user