From 1e128041cd1ca483ba57e5a3c876fa1211a49e73 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 4 Jul 2025 08:50:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E5=A4=9A=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E5=AF=BC=E8=87=B4=E7=9A=84=E8=BF=94=E5=B7=A5=E5=A1=AB?= =?UTF-8?q?=E5=86=99bug2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 2 ++ apps/wpm/views.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index a58acb27..fbefcf9d 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -740,6 +740,8 @@ class MlogbInSerializer(CustomModelSerializer): route = attrs.get("route", None) if not route: raise ParseError("缺少工艺步骤") + else: + attrs["route"] = route else: route = mlog_route attrs["route"] = route diff --git a/apps/wpm/views.py b/apps/wpm/views.py index 8be227da..47ea6a60 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -601,7 +601,7 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust if material_out is None: raise ParseError('产物不可为空') # 如果是主要输入物料且是主批次,才需生成输出 - if route and route.material_in != material_in or mlogbin.parent is not None: + if is_fix is False and route and route.material_in != material_in or mlogbin.parent is not None: return wm_in: WMaterial = mlogbin.wm_in