diff --git a/InvenTree/InvenTree/serializers.py b/InvenTree/InvenTree/serializers.py index c00c9ef690..6b5bdaef22 100644 --- a/InvenTree/InvenTree/serializers.py +++ b/InvenTree/InvenTree/serializers.py @@ -58,7 +58,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer): for field_name, field in fields.fields.items(): - if field.has_default(): + if field.has_default() and field_name not in initials: value = field.default @@ -87,7 +87,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer): for field_name, field in fields.fields.items(): if field.has_default(): - if field not in self._validated_data: + if field_name not in self._validated_data.keys(): value = field.default @@ -97,7 +97,6 @@ class InvenTreeModelSerializer(serializers.ModelSerializer): self._validated_data[field_name] = value - return valid def run_validation(self, data=empty):