mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add ability to create a new supplierpart from the API
This commit is contained in:
parent
907bccf748
commit
9b4e86f36a
@ -146,7 +146,7 @@ class BomList(generics.ListAPIView):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class SupplierPartList(generics.ListAPIView):
|
class SupplierPartList(generics.ListCreateAPIView):
|
||||||
|
|
||||||
queryset = SupplierPart.objects.all()
|
queryset = SupplierPart.objects.all()
|
||||||
serializer_class = SupplierPartSerializer
|
serializer_class = SupplierPartSerializer
|
||||||
|
@ -90,8 +90,9 @@ class SupplierPartSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||||
|
|
||||||
part = PartBriefSerializer(many=False, read_only=True)
|
part_name = serializers.CharField(source='part.name', read_only=True)
|
||||||
supplier = CompanyBriefSerializer(many=False, read_only=True)
|
|
||||||
|
supplier_name = serializers.CharField(source='supplier.name', read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SupplierPart
|
model = SupplierPart
|
||||||
@ -99,7 +100,9 @@ class SupplierPartSerializer(serializers.ModelSerializer):
|
|||||||
'pk',
|
'pk',
|
||||||
'url',
|
'url',
|
||||||
'part',
|
'part',
|
||||||
|
'part_name',
|
||||||
'supplier',
|
'supplier',
|
||||||
|
'supplier_name',
|
||||||
'SKU',
|
'SKU',
|
||||||
'manufacturer',
|
'manufacturer',
|
||||||
'MPN',
|
'MPN',
|
||||||
|
Loading…
Reference in New Issue
Block a user