fix: mlog create取消批次号校验
This commit is contained in:
parent
d072a01bf8
commit
78db88f368
|
@ -102,13 +102,13 @@ class MlogSerializer(CustomModelSerializer):
|
|||
if mtask:
|
||||
validated_data['mgroup'] = mtask.mgroup
|
||||
validated_data['material_out'] = mtask.material_out
|
||||
# if not WMaterial.objects.filter(batch=batch).exists():
|
||||
# raise ValidationError('批次号不存在')
|
||||
else:
|
||||
mgroup = validated_data['mgroup']
|
||||
material_out = validated_data['material_out']
|
||||
if not (mgroup and material_out):
|
||||
raise ValidationError('缺少工段或产物!')
|
||||
if not WMaterial.objects.filter(batch=batch).exists():
|
||||
raise ValidationError('批次号不存在')
|
||||
if Mlog.objects.filter(mtask=mtask, batch=batch, handle_date=handle_date, handle_user=handle_user).exists():
|
||||
raise ValidationError('存在相同的日志记录')
|
||||
return super().create(validated_data)
|
||||
|
|
Loading…
Reference in New Issue