feat: 出入库明细可默认批次为无

This commit is contained in:
caoqianming 2025-09-04 10:55:56 +08:00
parent 0c08543e9c
commit 4cffb8a563
2 changed files with 4 additions and 2 deletions

View File

@ -153,7 +153,9 @@ class MIOItemCreateSerializer(CustomModelSerializer):
validated_data["batch"] = wm.batch
material: Material = validated_data['material']
batch = validated_data['batch']
batch = validated_data.get("batch", None)
if not batch:
batch = ""
if material.is_hidden:
raise ParseError('隐式物料不可出入库')
if mio.type in [MIO.MIO_TYPE_RETURN_IN, MIO.MIO_TYPE_BORROW_OUT]:

View File

@ -148,7 +148,7 @@ def daoru_mioitems(path:str, mio:MIO):
if batch:
pass
else:
batch = "批次"
batch = ""
count = sheet[f"c{ind}"].value
warehouse_name = sheet[f"d{ind}"].value
try: