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