diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 50e0150d46..18498207c2 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -146,7 +146,7 @@ class BomList(generics.ListAPIView): ] -class SupplierPartList(generics.ListAPIView): +class SupplierPartList(generics.ListCreateAPIView): queryset = SupplierPart.objects.all() serializer_class = SupplierPartSerializer diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index 378dbe4732..5a501b0f7c 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -90,8 +90,9 @@ class SupplierPartSerializer(serializers.ModelSerializer): url = serializers.CharField(source='get_absolute_url', read_only=True) - part = PartBriefSerializer(many=False, read_only=True) - supplier = CompanyBriefSerializer(many=False, read_only=True) + part_name = serializers.CharField(source='part.name', read_only=True) + + supplier_name = serializers.CharField(source='supplier.name', read_only=True) class Meta: model = SupplierPart @@ -99,7 +100,9 @@ class SupplierPartSerializer(serializers.ModelSerializer): 'pk', 'url', 'part', + 'part_name', 'supplier', + 'supplier_name', 'SKU', 'manufacturer', 'MPN',