From f3f0ea132c35543d0c43d1bf89780246b4f06304 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 1 Aug 2024 10:30:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20find=5Fmaterial=5Fcan=5Fchange=20?= =?UTF-8?q?=E5=8F=AA=E5=8F=AF=E8=BF=94=E5=B7=A5=E5=88=B0=E5=8D=8A=E6=88=90?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 933abf07..a20d11f9 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -22,7 +22,7 @@ def find_material_can_change(material: Material, mgroup_to: Mgroup): 找到可转变为的物料(返工交接用) """ routepackIds = Route.objects.filter(material_out=material, routepack__state=RoutePack.RP_S_CONFIRM).values_list('routepack', flat=True) - matIds = list(Route.objects.filter(routepack__id__in=routepackIds, process=mgroup_to.process).values_list('material_in', flat=True).distinct()) + matIds = list(Route.objects.filter(routepack__id__in=routepackIds, process=mgroup_to.process, material_in__type__in=[Material.MA_TYPE_HALFGOOD, Material.MA_TYPE_GOOD]).values_list('material_in', flat=True).distinct()) if matIds and len(matIds) == 1: return Material.objects.get(id=matIds[0]) raise ParseError("无法返工到该工段")