inm audit bug
This commit is contained in:
parent
9c0fb20743
commit
fbebb176aa
|
@ -190,15 +190,16 @@ class FIFOViewSet(ListModelMixin, DestroyModelMixin, GenericViewSet):
|
|||
审核通过
|
||||
"""
|
||||
obj = self.get_object()
|
||||
if obj.type == FIFO.FIFO_TYPE_SALE_OUT: # 如果是销售提货,需额外处理
|
||||
pass
|
||||
if not FIFOItem.objects.filter(fifo=obj).exists():
|
||||
raise ValidationError('出入库条目为空')
|
||||
for i in FIFOItem.objects.filter(fifo=obj, need_test=True):
|
||||
if not i.is_testok:
|
||||
raise APIException('未检验通过, 不可审核')
|
||||
if obj.is_audited:
|
||||
raise APIException('该入库记录已审核通过')
|
||||
raise APIException('该入库记录已审核通过')
|
||||
if obj.type == FIFO.FIFO_TYPE_SALE_OUT: # 如果是销售提货,需额外处理
|
||||
InmService.sale_out_audit(obj)
|
||||
else:
|
||||
if not FIFOItem.objects.filter(fifo=obj).exists():
|
||||
raise ValidationError('出入库条目为空')
|
||||
for i in FIFOItem.objects.filter(fifo=obj, need_test=True):
|
||||
if not i.is_testok:
|
||||
raise APIException('未检验通过, 不可审核')
|
||||
obj.is_audited = True
|
||||
obj.auditor = request.user
|
||||
obj.inout_date = timezone.now() # 也是审核日期
|
||||
|
|
Loading…
Reference in New Issue