feat: mioitem wm校验
This commit is contained in:
parent
1289c19aaa
commit
0474d0a943
|
@ -119,7 +119,8 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
||||||
mio:MIO = validated_data['mio']
|
mio:MIO = validated_data['mio']
|
||||||
mb = validated_data.get('mb', None)
|
mb = validated_data.get('mb', None)
|
||||||
wm = validated_data.get('wm', None)
|
wm = validated_data.get('wm', None)
|
||||||
if mio.type == MIO.MIO_TYPE_DO_IN:
|
assemb = validated_data.pop('assemb', [])
|
||||||
|
if mio.type == MIO.MIO_TYPE_DO_IN and not assemb:
|
||||||
if not wm:
|
if not wm:
|
||||||
raise ParseError('生产入库必须指定车间库存')
|
raise ParseError('生产入库必须指定车间库存')
|
||||||
elif mio.type == MIO.MIO_TYPE_DO_OUT:
|
elif mio.type == MIO.MIO_TYPE_DO_OUT:
|
||||||
|
@ -150,7 +151,6 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
count = validated_data["count"]
|
count = validated_data["count"]
|
||||||
batch = validated_data["batch"]
|
batch = validated_data["batch"]
|
||||||
assemb = validated_data.pop('assemb', [])
|
|
||||||
mioitemw = validated_data.pop('mioitemw', [])
|
mioitemw = validated_data.pop('mioitemw', [])
|
||||||
instance = super().create(validated_data)
|
instance = super().create(validated_data)
|
||||||
assemb_dict = {}
|
assemb_dict = {}
|
||||||
|
|
Loading…
Reference in New Issue