fix: handover拆批请选择车间库存

This commit is contained in:
caoqianming 2025-04-14 15:19:45 +08:00
parent 882b0f2cbd
commit 22b6b1305f
1 changed files with 2 additions and 0 deletions

View File

@ -729,6 +729,8 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
elif mtype == Handover.H_DIV: elif mtype == Handover.H_DIV:
batch = handover_or_b.batch batch = handover_or_b.batch
target, _ = BatchSt.g_create(batch=batch, handover=handover, material_start=material) target, _ = BatchSt.g_create(batch=batch, handover=handover, material_start=material)
if handover.wm is None:
raise ParseError('拆批请选择车间库存')
source, _ = BatchSt.g_create(batch=handover.wm.batch) source, _ = BatchSt.g_create(batch=handover.wm.batch)
BatchLog.g_create(source=source, target=target, handover=handover, relation_type="split") BatchLog.g_create(source=source, target=target, handover=handover, relation_type="split")
else: else: