feat: 采购入库节点可复用

This commit is contained in:
caoqianming 2025-06-09 15:37:17 +08:00
parent 016ef53517
commit 7d29b9c4eb
1 changed files with 1 additions and 2 deletions

View File

@ -673,8 +673,7 @@ class BatchSt(BaseModel):
cls_qs = cls.objects.filter(batch=batch)
if cls_qs.exists():
if reuse_node:
node:BatchSt = (cls_qs.filter(mio__isnull=False)|cls_qs.filter(
material_start__isnull=True)).order_by('-version').first()
node:BatchSt = (cls_qs.filter(mio__isnull=False)|cls_qs.filter(hanover=None, mio=None, mlog=None)).order_by('-version').first()
if node is None:
raise ParseError(f"{batch}-该批次号因物料不同不可引用")
elif node.material_start is None: