mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +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:
		@@ -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'],
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user