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:
@ -363,6 +363,15 @@ class StockLocationList(generics.ListCreateAPIView):
|
||||
ordering_fields = [
|
||||
'name',
|
||||
'items',
|
||||
'level',
|
||||
'tree_id',
|
||||
'lft',
|
||||
]
|
||||
|
||||
ordering = [
|
||||
'tree_id',
|
||||
'lft',
|
||||
'name',
|
||||
]
|
||||
|
||||
|
||||
|
@ -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',
|
||||
|
Reference in New Issue
Block a user