feat: mioitemw为1个时自动创建
This commit is contained in:
parent
38978c9dea
commit
53f3f25030
|
@ -127,7 +127,7 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
||||||
|
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
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 mb:
|
if mb:
|
||||||
|
@ -186,6 +186,12 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
||||||
raise ParseError('请提供产品明细编号')
|
raise ParseError('请提供产品明细编号')
|
||||||
else:
|
else:
|
||||||
raise ParseError('不支持自动生成请提供产品明细')
|
raise ParseError('不支持自动生成请提供产品明细')
|
||||||
|
elif len(mioitemw) >= 1:
|
||||||
|
pass
|
||||||
|
elif mio.type in [MIO.MIO_TYPE_PUR_IN, MIO.MIO_TYPE_OTHER_IN] and count==1:
|
||||||
|
MIOItemw.objects.create(mioitem=instance, number=batch)
|
||||||
|
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue