feat: 按个选入消耗时统计mlog数据

This commit is contained in:
caoqianming 2025-07-07 10:34:40 +08:00
parent e57e087006
commit 30bb96cf6c
2 changed files with 2 additions and 1 deletions

View File

@ -506,6 +506,7 @@ class Mlogbw(BaseModel):
if mlogb.material_in:
mlogb.count_use = count
mlogb.save(update_fields=["count_use"])
mlogb.cal_count_notok(cal_mlog=True)
elif mlogb.material_out:
mlogb.count_real = count
count_notok = 0

View File

@ -579,7 +579,7 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust
@transaction.atomic
def perform_update(self, serializer):
ins = serializer.save()
ins:Mlogb = serializer.save()
ins.mlog.cal_mlog_count_from_mlogb()
@transaction.atomic