diff --git a/apps/wpm/models.py b/apps/wpm/models.py index cc344e1a..d7cba635 100644 --- a/apps/wpm/models.py +++ b/apps/wpm/models.py @@ -641,7 +641,7 @@ class BatchSt(BaseModel): # 带有来源的批次获取,需检查批次号是否可用 if cls.objects.filter(batch=batch).exists(): if reuse_node: - node = cls.objects.filter(batch=batch).order_by('-version').first() + node = cls.objects.filter(batch=batch, mio__isnull=False).order_by('-version').first() if node.material_start is not None and node.material_start != material_start: raise ParseError(f"{batch}-该批次号因物料不同不可引用") return node, False