fix: mlogbw删除bug
This commit is contained in:
parent
e52b894603
commit
8bd3e120df
|
|
@ -797,7 +797,7 @@ class MlogbwViewSet(CustomModelViewSet):
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def perform_destroy(self, instance:Mlogbw):
|
def perform_destroy(self, instance:Mlogbw):
|
||||||
mlogb:Mlogb = instance.mlogb
|
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("不能删除该产出明细")
|
raise ParseError("不能删除该产出明细")
|
||||||
|
|
||||||
ftest = instance.ftest
|
ftest = instance.ftest
|
||||||
|
|
@ -805,7 +805,7 @@ class MlogbwViewSet(CustomModelViewSet):
|
||||||
ftest.delete()
|
ftest.delete()
|
||||||
instance.delete()
|
instance.delete()
|
||||||
Mlogbw.cal_count_notok(mlogb)
|
Mlogbw.cal_count_notok(mlogb)
|
||||||
|
|
||||||
# 如果是输入且输出追踪到个,需同步删除
|
# 如果是输入且输出追踪到个,需同步删除
|
||||||
material_in: Material = mlogb.material_in
|
material_in: Material = mlogb.material_in
|
||||||
if material_in is not None:
|
if material_in is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue