fix: mlogserializer需要同步count_real
This commit is contained in:
parent
6d87a69d8d
commit
680608e16f
|
@ -518,6 +518,8 @@ class MlogSerializer(CustomModelSerializer):
|
|||
batch_out = generate_new_batch(batch_in, instance)
|
||||
mox, _ = Mlogb.objects.get_or_create(mlog=instance, batch=batch_out,
|
||||
mtask=instance.mtask, material_out=instance.material_out)
|
||||
# 需要同步更新数量
|
||||
mox.count_real = instance.count_real
|
||||
mox.count_ok = instance.count_ok
|
||||
mox.count_notok = instance.count_notok
|
||||
mox.count_break_t = instance.count_break_t
|
||||
|
|
|
@ -150,6 +150,8 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
|
|||
"""
|
||||
生产日志提交后需要执行的操作
|
||||
"""
|
||||
if mlog.count_real == 0:
|
||||
raise ParseError('产出数量不能为0')
|
||||
if mlog.submit_time is not None:
|
||||
return
|
||||
if now is None:
|
||||
|
|
Loading…
Reference in New Issue