fix: puorder puplan submit_time不可更改

This commit is contained in:
caoqianming 2023-10-12 08:39:18 +08:00
parent af920a66f7
commit 450381d7fb
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class PuPlanSerializer(CustomModelSerializer):
class Meta:
model = PuPlan
fields = '__all__'
read_only_fields = EXCLUDE_FIELDS_DEPT + ['state']
read_only_fields = EXCLUDE_FIELDS_DEPT + ['state', 'submit_time']
def update(self, instance, validated_data):
if instance.state != PuPlan.PUPLAN_CREATE:
@ -64,7 +64,7 @@ class PuOrderSerializer(CustomModelSerializer):
class Meta:
model = PuOrder
fields = '__all__'
read_only_fields = EXCLUDE_FIELDS_DEPT + ['state']
read_only_fields = EXCLUDE_FIELDS_DEPT + ['state', 'submit_time']
def update(self, instance, validated_data):
validated_data.pop('supplier')