fix: mlogbw删除bug

This commit is contained in:
caoqianming 2025-03-12 14:53:28 +08:00
parent e52b894603
commit 8bd3e120df
1 changed files with 2 additions and 2 deletions

View File

@ -797,7 +797,7 @@ class MlogbwViewSet(CustomModelViewSet):
@transaction.atomic
def perform_destroy(self, instance:Mlogbw):
mlogb:Mlogb = instance.mlogb
if mlogb.material_out is not None and mlogb.wpr is not None:
if mlogb.material_out is not None and instance.wpr is not None:
raise ParseError("不能删除该产出明细")
ftest = instance.ftest
@ -805,7 +805,7 @@ class MlogbwViewSet(CustomModelViewSet):
ftest.delete()
instance.delete()
Mlogbw.cal_count_notok(mlogb)
# 如果是输入且输出追踪到个,需同步删除
material_in: Material = mlogb.material_in
if material_in is not None: