feat: 批次号格式错误的校验
This commit is contained in:
parent
5d7c681983
commit
5fa4881614
|
|
@ -156,6 +156,8 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
|||
batch = validated_data.get("batch", None)
|
||||
if not batch:
|
||||
batch = "无"
|
||||
if batch != '无' and len(batch) < 5:
|
||||
raise ParseError('批次号格式错误')
|
||||
if material.is_hidden:
|
||||
raise ParseError('隐式物料不可出入库')
|
||||
if mio.type in [MIO.MIO_TYPE_RETURN_IN, MIO.MIO_TYPE_BORROW_OUT]:
|
||||
|
|
|
|||
|
|
@ -156,6 +156,8 @@ def daoru_mioitems(path:str, mio:MIO):
|
|||
pass
|
||||
else:
|
||||
batch = "无"
|
||||
if batch != '无' and len(batch) < 5:
|
||||
raise ParseError('批次号格式错误')
|
||||
count = sheet[f"f{ind}"].value
|
||||
warehouse_name = sheet[f"g{ind}"].value
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in New Issue