fix: 日志多步骤导致的返工填写bug2

This commit is contained in:
caoqianming 2025-07-04 08:50:03 +08:00
parent 433218feed
commit 1e128041cd
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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