feat: 按个选入消耗时统计mlog数据
This commit is contained in:
parent
e57e087006
commit
30bb96cf6c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue