fix: handover 合批时创建关系链的bug
This commit is contained in:
parent
f57604492b
commit
5ee10e7cc5
|
@ -710,13 +710,16 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
|
||||||
batches = [new_batch]
|
batches = [new_batch]
|
||||||
else:
|
else:
|
||||||
raise ParseError("合并批次时请提供新批次号")
|
raise ParseError("合并批次时请提供新批次号")
|
||||||
|
create_new_batch = False
|
||||||
for item in handoverb_list:
|
for item in handoverb_list:
|
||||||
wm_from, xcount, handover_or_b = item
|
wm_from, xcount, handover_or_b = item
|
||||||
|
|
||||||
# 合并为新批
|
# 合并为新批
|
||||||
if mtype == Handover.H_MERGE:
|
if mtype == Handover.H_MERGE:
|
||||||
batch = new_batch
|
batch = new_batch
|
||||||
|
if create_new_batch is False:
|
||||||
BatchSt.create(batch=batch, handover=handover)
|
BatchSt.create(batch=batch, handover=handover)
|
||||||
|
create_new_batch = True
|
||||||
BatchLog.g_create(source_b=wm_from.batch, target_b=batch, handover=handover, relation_type="merge")
|
BatchLog.g_create(source_b=wm_from.batch, target_b=batch, handover=handover, relation_type="merge")
|
||||||
elif mtype == Handover.H_DIV:
|
elif mtype == Handover.H_DIV:
|
||||||
batch = handover_or_b.batch
|
batch = handover_or_b.batch
|
||||||
|
|
Loading…
Reference in New Issue