diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index a2f9f501..a66ba32d 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -1075,6 +1075,9 @@ class HandoverSerializer(CustomModelSerializer): raise ParseError('必须指定收料车间或收料工段') if not attrs.get('send_dept', None) and not attrs.get('send_mgroup', None): raise ParseError('必须指定送料车间或送料工段') + + if attrs["type"] == Handover.H_NORMAL and attrs.get("recive_mgroup", None) == attrs.get("send_mgroup", None): + raise ParseError('正常交接收料工段与送料工段不能相同') t_count = 0 tracking = attrs["material"].tracking for ind, item in enumerate(attrs['handoverb']):