Mark some fields as not-required via the API

This commit is contained in:
Oliver Walters 2020-05-28 20:33:33 +10:00
parent f8e36c5468
commit 774e26eb19

View File

@ -104,12 +104,14 @@ class StockItemSerializer(InvenTreeModelSerializer):
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
supplier_part_detail = SupplierPartSerializer(source='supplier_part', many=False, read_only=True)
tracking_items = serializers.IntegerField(source='tracking_info_count')
tracking_items = serializers.IntegerField(source='tracking_info_count', read_only=True, required=False)
quantity = serializers.FloatField()
allocated = serializers.FloatField(source='allocation_count')
allocated = serializers.FloatField(source='allocation_count', required=False)
required_tests = serializers.IntegerField(source='required_test_count', read_only=True)
serial = serializers.IntegerField(required=False)
required_tests = serializers.IntegerField(source='required_test_count', read_only=True, required=False)
def __init__(self, *args, **kwargs):