diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 59914f5e..17144e96 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -592,7 +592,7 @@ class HandoverSerializer(CustomModelSerializer): attrs['send_dept'] = wm.belong_dept if handoverb[0]["wm"].mgroup: attrs['send_mgroup'] = handoverb[0]["wm"].mgroup - if material.process and material.process.into_wm_mgroup and 'recive_mgroup' not in attrs: + if attrs['material'].process and attrs['material'].process.into_wm_mgroup and 'recive_mgroup' not in attrs: raise ValidationError('必须指定交接工段') if 'recive_mgroup' in attrs and attrs['recive_mgroup']: attrs['recive_dept'] = attrs['recive_mgroup'].belong_dept