diff --git a/apps/wpm/models.py b/apps/wpm/models.py index 8f0c2609..33b44d1c 100644 --- a/apps/wpm/models.py +++ b/apps/wpm/models.py @@ -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: