diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 0f5c96fd..b06e4bd8 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -732,6 +732,25 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, ) else: 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: raise ParseError("不支持该交接类型")