Add item count to StockLocation serializer

This commit is contained in:
Oliver Walters 2020-04-03 11:41:51 +11:00
parent d4da6211be
commit ccb637773f

View File

@ -119,6 +119,8 @@ class LocationSerializer(InvenTreeModelSerializer):
url = serializers.CharField(source='get_absolute_url', read_only=True)
items = serializers.IntegerField(source='item_count', read_only=True)
class Meta:
model = StockLocation
fields = [
@ -127,7 +129,8 @@ class LocationSerializer(InvenTreeModelSerializer):
'name',
'description',
'parent',
'pathstring'
'pathstring',
'items',
]