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