From 5ee10e7cc51d0075f4b74be4044bf7c44856dd8c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 24 Mar 2025 08:41:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20handover=20=E5=90=88=E6=89=B9=E6=97=B6?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=85=B3=E7=B3=BB=E9=93=BE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index e017a5b4..0d71ee0e 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -710,13 +710,16 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, batches = [new_batch] else: raise ParseError("合并批次时请提供新批次号") + create_new_batch = False for item in handoverb_list: wm_from, xcount, handover_or_b = item # 合并为新批 if mtype == Handover.H_MERGE: batch = new_batch - BatchSt.create(batch=batch, handover=handover) + if create_new_batch is False: + 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") elif mtype == Handover.H_DIV: batch = handover_or_b.batch