diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index fe7483b399..3183a7caf9 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -78,16 +78,15 @@ class PartSerializer(InvenTreeModelSerializer): Used when displaying all details of a single component. """ - url = serializers.CharField(source='get_absolute_url', read_only=True) - image = serializers.CharField(source='get_image_url', read_only=True) - thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True) - category_name = serializers.CharField(source='category_path', read_only=True) - allocated_stock = serializers.FloatField(source='allocation_count', read_only=True) - - on_order = serializers.FloatField(read_only=True) - + bom_items = serializers.IntegerField(source='bom_count', read_only=True) building = serializers.FloatField(source='quantity_being_built', read_only=False) + category_name = serializers.CharField(source='category_path', read_only=True) + image = serializers.CharField(source='get_image_url', read_only=True) + on_order = serializers.FloatField(read_only=True) + thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True) + url = serializers.CharField(source='get_absolute_url', read_only=True) + used_in = serializers.IntegerField(source='used_in_count', read_only=True) @staticmethod def setup_eager_loading(queryset): @@ -103,6 +102,7 @@ class PartSerializer(InvenTreeModelSerializer): fields = [ 'pk', 'url', # Link to the part detail page + 'bom_items', 'category', 'category_name', 'image', @@ -120,6 +120,7 @@ class PartSerializer(InvenTreeModelSerializer): 'on_order', 'building', 'units', + 'used_in', 'trackable', 'assembly', 'component',