refector: 检验撤回根据count_notok进行update_mb
This commit is contained in:
parent
e33b4e5902
commit
7b83cd1095
|
@ -266,9 +266,10 @@ class MIOItemViewSet(ListModelMixin, BulkCreateModelMixin, BulkDestroyModelMixin
|
|||
mio: MIO = ins.mio
|
||||
if ins.test_date is None:
|
||||
raise ParseError('该明细还未检验')
|
||||
InmService.update_mb_item(ins, 1, 'count_notok', mio.type, mio.belong_dept)
|
||||
ins.test_date = None
|
||||
ins.save()
|
||||
if ins.count_notok > 0:
|
||||
InmService.update_mb_item(ins, 1, 'count_notok', mio.type, mio.belong_dept)
|
||||
ins.test_date = None
|
||||
ins.save()
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post': 'mioitem.test'}, serializer_class=MIOItemPurInTestSerializer)
|
||||
|
|
Loading…
Reference in New Issue