feat: attrs["count"] = len(attrs["handoverb"])

This commit is contained in:
caoqianming 2025-03-13 10:58:09 +08:00
parent 71b67b7210
commit 31ef257a60
1 changed files with 3 additions and 0 deletions

View File

@ -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: