fix: 生成产出出错3的bug

This commit is contained in:
caoqianming 2025-03-12 11:22:50 +08:00
parent 9a7230d752
commit 378648436f
1 changed files with 2 additions and 1 deletions

View File

@ -609,9 +609,10 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
elif mlogbin.mlogb_to != mlogbout:
raise ParseError("生成产出出错1")
elif mtype == Process.PRO_DIV:
div_number = route.div_number
for mlogbwin in Mlogbw.objects.filter(mlogb=mlogbin).order_by("number"):
mlogbout, _ = Mlogb.objects.get_or_create(**m_dict, defaults=
{"batch_ofrom": wm_in.batch_ofrom, "material_ofrom": wm_in.material_ofrom, "count_real": d_count_real, "count_ok": d_count_ok, "qct": qct})
{"batch_ofrom": wm_in.batch_ofrom, "material_ofrom": wm_in.material_ofrom, "count_real": div_number, "count_ok": div_number, "qct": qct})
if mlogbwin.mlogb_to is None:
mlogbwin.mlogb_to = mlogbout
mlogbwin.save(update_fields = ["mlogb_to"])