fix: handoverb validate错误
This commit is contained in:
parent
beb6b79709
commit
4b44b40c77
|
@ -582,6 +582,7 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if wm:
|
||||
material = wm.material
|
||||
attrs['handoverb'] = [{"wm": wm, "count": attrs["count"] }]
|
||||
handoverb = attrs['handoverb']
|
||||
elif handoverb:
|
||||
wm: WMaterial = handoverb[0]["wm"]
|
||||
else:
|
||||
|
@ -600,7 +601,7 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if 'send_dept' not in attrs and 'send_mgroup' not in attrs:
|
||||
raise ValidationError('送料车间和送料工段必须有一个')
|
||||
t_count = 0
|
||||
for ind, item in enumerate(handoverb):
|
||||
for ind, item in enumerate(attrs['handoverb']):
|
||||
wm = item["wm"]
|
||||
t_count += item["count"]
|
||||
if attrs["material"] != wm.material:
|
||||
|
|
Loading…
Reference in New Issue