diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 9c0ef4e4..c654ee8e 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -970,6 +970,9 @@ class HandoverSerializer(CustomModelSerializer): recive_mgroup = attrs.get("recive_mgroup", None) if recive_mgroup is None: raise ParseError('返工交接需指定工段') + material:Material = attrs["material"] + if material.tracking == Material.MA_TRACKING_SINGLE: + attrs["count"] = len(attrs["handoverb"]) return attrs class Meta: