feat: mioitemcreate 增加校验
This commit is contained in:
parent
a0084f7825
commit
1761dcdf6d
|
@ -119,6 +119,12 @@ 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:
|
||||
if not wm:
|
||||
raise ParseError('生产入库必须指定车间库存')
|
||||
elif mio.type == MIO.MIO_TYPE_DO_OUT:
|
||||
if not mb:
|
||||
raise ParseError('生产领料必须指定仓库库存')
|
||||
if mb:
|
||||
validated_data["material"] = mb.material
|
||||
validated_data["batch"] = mb.batch
|
||||
|
|
Loading…
Reference in New Issue