fix: materialserializer count只读

This commit is contained in:
caoqianming 2024-01-29 18:10:07 +08:00
parent 22978de879
commit 32733e9800
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class MaterialSerializer(CustomModelSerializer):
class Meta:
model = Material
fields = '__all__'
read_only_fields = EXCLUDE_FIELDS
read_only_fields = EXCLUDE_FIELDS + ['count']
def get_full_name(self, obj):
return f'{obj.name}|{obj.specification if obj.specification else ""}|{obj.model if obj.model else ""}|{obj.process.name if obj.process else ""}'