fix: 次批作为输入不会影响输出批次号

This commit is contained in:
caoqianming 2025-09-15 15:48:21 +08:00
parent ed2804c098
commit 9bf44c4211
1 changed files with 27 additions and 13 deletions

View File

@ -747,7 +747,7 @@ class MlogbInViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, BulkDestroyMode
# if qct is None:
# mlog.qct = Qct.get(material_out, "process")
# mlog.save(update_fields = ["qct"])
if mlogbin_parent is None:
m_dict = {
"mtask": mlogbin.mtask,
"route": route,
@ -761,6 +761,20 @@ class MlogbInViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, BulkDestroyMode
pass
else:
m_dict['batch'] = generate_new_batch(mlogbin.batch, mlog)
else:
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