fix: mlogbw delete bug3
This commit is contained in:
parent
459d2348d4
commit
e52b894603
|
@ -800,6 +800,12 @@ class MlogbwViewSet(CustomModelViewSet):
|
||||||
if mlogb.material_out is not None and mlogb.wpr is not None:
|
if mlogb.material_out is not None and mlogb.wpr is not None:
|
||||||
raise ParseError("不能删除该产出明细")
|
raise ParseError("不能删除该产出明细")
|
||||||
|
|
||||||
|
ftest = instance.ftest
|
||||||
|
if ftest:
|
||||||
|
ftest.delete()
|
||||||
|
instance.delete()
|
||||||
|
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:
|
||||||
|
@ -807,10 +813,4 @@ class MlogbwViewSet(CustomModelViewSet):
|
||||||
Mlogb.objects.filter(id=instance.mlogb_to.id).delete()
|
Mlogb.objects.filter(id=instance.mlogb_to.id).delete()
|
||||||
if instance.mlogbw_to:
|
if instance.mlogbw_to:
|
||||||
instance.mlogbw_to.delete()
|
instance.mlogbw_to.delete()
|
||||||
instance.delete()
|
|
||||||
Mlogbw.cal_count_notok(instance.mlogbw_to.mlogb)
|
Mlogbw.cal_count_notok(instance.mlogbw_to.mlogb)
|
||||||
ftest = instance.ftest
|
|
||||||
if ftest:
|
|
||||||
ftest.delete()
|
|
||||||
instance.delete()
|
|
||||||
Mlogbw.cal_count_notok(mlogb)
|
|
||||||
|
|
Loading…
Reference in New Issue