feat: mlog revert bug
This commit is contained in:
parent
4b327c0575
commit
ee3dc6a5a2
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue