From b4d66c6797650fb63579cbf56b62a122938f98f8 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 5 Apr 2020 15:29:31 +1000 Subject: [PATCH] Add 'building' count to Part detail API --- InvenTree/part/serializers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index a48aaaa54d..fe7483b399 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -83,7 +83,11 @@ class PartSerializer(InvenTreeModelSerializer): thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True) category_name = serializers.CharField(source='category_path', read_only=True) - allocated_stock = serializers.IntegerField(source='allocation_count', read_only=True) + allocated_stock = serializers.FloatField(source='allocation_count', read_only=True) + + on_order = serializers.FloatField(read_only=True) + + building = serializers.FloatField(source='quantity_being_built', read_only=False) @staticmethod def setup_eager_loading(queryset): @@ -114,6 +118,7 @@ class PartSerializer(InvenTreeModelSerializer): 'total_stock', 'allocated_stock', 'on_order', + 'building', 'units', 'trackable', 'assembly',