feat: 添加物料明细与批次不匹配的校验
This commit is contained in:
parent
d84b8e94fd
commit
df4b062209
|
@ -1275,6 +1275,13 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if handoverbw:
|
||||
item["count"] = len(handoverbw)
|
||||
t_count += len(handoverbw)
|
||||
wprIds = [i["wpr"].id for i in handoverbw]
|
||||
wm_ids = Wpr.objects.filter(id__in=wprIds).values_list("wm_id", flat=True)
|
||||
if len(wm_ids) == 1 and wm_ids[0] == wm.id:
|
||||
pass
|
||||
else:
|
||||
raise ParseError(f'第{ind+1}行-物料明细与批次不匹配')
|
||||
|
||||
elif wm.count == item["count"]:
|
||||
t_count += item["count"]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue