From 59b8634d3e549a0ba442a163aeb36d8480a9251c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 2 Jul 2024 23:25:14 +0800 Subject: [PATCH] fix: handover serializer bug2 --- apps/wpm/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index a1e913f0..febb484f 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -345,8 +345,8 @@ class HandoverSerializer(CustomModelSerializer): attrs['send_dept'] = attrs['wm'].belong_dept if attrs['wm'].mgroup: attrs['send_mgroup'] = attrs['wm'].mgroup - if material.process and material.process.into_wm_mgroup and 'recive_mgroup' not in attrs: - raise ValidationError('必须指定交接工段') + if material.process and material.process.into_wm_mgroup and 'recive_mgroup' not in attrs: + raise ValidationError('必须指定交接工段') if attrs.get('recive_mgroup', None): attrs['recive_dept'] = attrs['recive_mgroup'].belong_dept if 'recive_dept' not in attrs and 'recive_mgroup' not in attrs: @@ -356,7 +356,7 @@ class HandoverSerializer(CustomModelSerializer): class Meta: model = Handover fields = '__all__' - read_only_fields = EXCLUDE_FIELDS + ["batch", "material", "send_dept", "mlog"] + read_only_fields = EXCLUDE_FIELDS + ["mlog"] extra_kwargs = { "wm": {"required": True}, "recive_mgroup": {"required": False}