feat: mlogbin时从单个拆分为多个批次2

This commit is contained in:
caoqianming 2025-03-10 16:03:50 +08:00
parent 85cc38c842
commit 8f46507a6b
1 changed files with 1 additions and 3 deletions

View File

@ -588,9 +588,7 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
if material_in.tracking == Material.MA_TRACKING_SINGLE:
if mlogbin.count_use == wm_in.count: # 自动创建mlogbw
for wpr in Wpr.objects.filter(wm=wm_in).order_by("number"):
Mlogbw.objects.get_or_create(wpr=wpr, mlogb=mlogbin, defaults={"number": wpr.number})
else:
raise ParseError("请提供消耗物料详细编号")
Mlogbw.objects.get_or_create(wpr=wpr, mlogb=mlogbin, defaults={"number": wpr.number})
if qct is None and not (is_fix and mtype == Process.PRO_PROD):
mlog.qct = Qct.get(material_out, "process")