2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Ordering and rendering for StockLocation

This commit is contained in:
Oliver Walters
2021-07-18 21:15:51 +10:00
parent 36cf614aed
commit 753fe9c80f
3 changed files with 15 additions and 5 deletions

View File

@ -363,6 +363,15 @@ class StockLocationList(generics.ListCreateAPIView):
ordering_fields = [
'name',
'items',
'level',
'tree_id',
'lft',
]
ordering = [
'tree_id',
'lft',
'name',
]

View File

@ -260,12 +260,15 @@ class LocationSerializer(InvenTreeModelSerializer):
items = serializers.IntegerField(source='item_count', read_only=True)
level = serializers.IntegerField(read_only=True)
class Meta:
model = StockLocation
fields = [
'pk',
'url',
'name',
'level',
'description',
'parent',
'pathstring',