feat: handover submit支持改版
This commit is contained in:
parent
66e4273b97
commit
821b88eb90
|
@ -732,6 +732,25 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise ParseError("不支持非工段报废")
|
raise ParseError("不支持非工段报废")
|
||||||
|
elif handover.type == Handover.H_CHANGE:
|
||||||
|
if handover.recive_mgroup:
|
||||||
|
wm_to, _ = WMaterial.objects.get_or_create(
|
||||||
|
batch=batch,
|
||||||
|
material=handover.material_changed,
|
||||||
|
mgroup=recive_mgroup,
|
||||||
|
belong_dept=recive_dept,
|
||||||
|
notok_sign=None,
|
||||||
|
defect=None,
|
||||||
|
material_origin=material,
|
||||||
|
state=WMaterial.WM_OK,
|
||||||
|
defaults={
|
||||||
|
"batch_ofrom": wm_from.batch_ofrom,
|
||||||
|
"material_ofrom": wm_from.material_ofrom,
|
||||||
|
"create_by": user
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise ParseError("改版交接必须指定接收工段")
|
||||||
else:
|
else:
|
||||||
raise ParseError("不支持该交接类型")
|
raise ParseError("不支持该交接类型")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue