fix: 个到个的拆分bug6

This commit is contained in:
caoqianming 2025-03-14 16:06:49 +08:00
parent 43ca73ab15
commit a66d47ec47
1 changed files with 4 additions and 1 deletions

View File

@ -597,7 +597,10 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
m_dict["batch"] = mlogbwin.number
Mlogb.objects.get_or_create(mlogbw_from=mlogbwin, defaults=update_dict(m_dict, {"count_real": div_number, "count_ok": div_number}))
elif material_in.tracking == Material.MA_TRACKING_SINGLE and material_out.tracking == Material.MA_TRACKING_SINGLE:
mlogbout, _ = Mlogb.objects.get_or_create(mlogb_from=mlogbin, defaults=update_dict(m_dict, {"count_real": d_count_real*div_number, "count_ok": d_count_ok*div_number}))
d_count_real = mlogbin.count_use * div_number
d_count_ok = d_count_real
mlogbout, _ = Mlogb.objects.get_or_create(mlogb_from=mlogbin, defaults=update_dict(m_dict,
{"count_real": d_count_real, "count_ok": d_count_ok}))
for mlogbwin in Mlogbw.objects.filter(mlogb=mlogbin).order_by("number"):
wpr_ = mlogbwin.wpr
for i in range(div_number):