feat: mlog revert bug

This commit is contained in:
caoqianming 2025-01-10 14:30:04 +08:00
parent 4b327c0575
commit ee3dc6a5a2
2 changed files with 3 additions and 2 deletions

View File

@ -230,8 +230,8 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
into_wm_mgroup = material_out.process.into_wm_mgroup if material_out.process else False
need_store_notok = material_out.process.store_notok if material_out.process else False
m_outs = Mlogb.objects.filter(mlog=mlog, material_out__isnull=False)
stored_notok = False
stored_mgroup = False
stored_notok = need_store_notok
stored_mgroup = need_store_notok
if m_outs.exists():
m_outs_list = [(mo.material_out, mo.batch if mo.batch else mlog.batch, mo.count_ok, mlog.count_real_eweight, None, mo) for mo in m_outs.all()]
if need_store_notok:

View File

@ -52,6 +52,7 @@ class Wpr(BaseModel):
ins.wm = wm
if wm:
ins.material = wm.material
ins.state = wm.state
ins.save()
if ftest: # 通过检验变更其缺陷项
WprDefect.objects.filter(wpr=ins).delete()