From 31ef257a60f2384b2ae9188561afce9e0e08f20a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 13 Mar 2025 10:58:09 +0800 Subject: [PATCH] feat: attrs["count"] = len(attrs["handoverb"]) --- apps/wpm/serializers.py | 3 +++ 1 file changed, 3 insertions(+) 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: