feat: 产出物为0时跳过revert

This commit is contained in:
caoqianming 2024-08-29 14:52:30 +08:00
parent 81a90f31cd
commit 54c7c65fe0
1 changed files with 2 additions and 0 deletions

View File

@ -339,6 +339,8 @@ def mlog_revert(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
for mo in m_outs_list:
mo_ma, mo_batch, mo_count, _, notok_sign = mo
if mo_count == 0:
continue
wm_state = WMaterial.WM_OK if notok_sign is None else WMaterial.WM_NOTOK
lookup = {'batch': mo_batch, 'material': mo_ma, 'mgroup': None, 'notok_sign': notok_sign, 'state': wm_state}
if stored_mgroup: