feat: mioitem处理事务处理

This commit is contained in:
caoqianming 2025-09-16 14:51:06 +08:00
parent f151f4f2ec
commit 7a3988d6bd
1 changed files with 51 additions and 51 deletions

View File

@ -171,7 +171,7 @@ class MIOItemCreateSerializer(CustomModelSerializer):
mis = MIOItem.objects.filter(batch=batch, material=material, mio__type__in=[MIO.MIO_TYPE_PUR_IN, MIO.MIO_TYPE_DO_IN, MIO.MIO_TYPE_OTHER_IN])
if mis.exists() and (not mis.exclude(test_date=None).exists()):
raise ParseError('该批次的物料未经检验')
with transaction.atomic():
count = validated_data["count"]
batch = validated_data["batch"]
mioitemw = validated_data.pop('mioitemw', [])