From 9bf44c42111944ed0a24707075f614e81d0d895c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 15 Sep 2025 15:48:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AC=A1=E6=89=B9=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E4=B8=8D=E4=BC=9A=E5=BD=B1=E5=93=8D=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=89=B9=E6=AC=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/views.py | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/apps/wpm/views.py b/apps/wpm/views.py index 55b951f0..8944e409 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -747,20 +747,34 @@ class MlogbInViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, BulkDestroyMode # if qct is None: # mlog.qct = Qct.get(material_out, "process") # mlog.save(update_fields = ["qct"]) - - m_dict = { - "mtask": mlogbin.mtask, - "route": route, - "mlog": mlog, - "material_out": material_out, - "batch": mlogbin.batch, - "batch_ofrom": wm_in.batch_ofrom, "material_ofrom": wm_in.material_ofrom, - "qct": Qct.get(material_out, "process", "out") - } - if mtype == Process.PRO_DIV and material_in.tracking == Material.MA_TRACKING_SINGLE: - pass + if mlogbin_parent is None: + m_dict = { + "mtask": mlogbin.mtask, + "route": route, + "mlog": mlog, + "material_out": material_out, + "batch": mlogbin.batch, + "batch_ofrom": wm_in.batch_ofrom, "material_ofrom": wm_in.material_ofrom, + "qct": Qct.get(material_out, "process", "out") + } + if mtype == Process.PRO_DIV and material_in.tracking == Material.MA_TRACKING_SINGLE: + pass + else: + m_dict['batch'] = generate_new_batch(mlogbin.batch, mlog) else: - m_dict['batch'] = generate_new_batch(mlogbin.batch, mlog) + m_dict = { + "mtask": mlogbin_parent.mtask, + "route": route, + "mlog": mlog, + "material_out": material_out, + "batch": mlogbin_parent.batch, + "batch_ofrom": mlogbin_parent.wm_in.batch_ofrom, "material_ofrom": mlogbin_parent.wm_in.material_ofrom, + "qct": Qct.get(material_out, "process", "out") + } + if mtype == Process.PRO_DIV and material_in.tracking == Material.MA_TRACKING_SINGLE: + pass + else: + m_dict['batch'] = generate_new_batch(mlogbin_parent.batch, mlog) if is_fix:# 支持批到批,个到个 d_count_real = mlogbin.count_use-mlogbin.count_pn_jgqbl