diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 4840a932..f12122b7 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -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: