From fafe39c1bd64e9d5bc9ea6bb1eadbf09c5d691c3 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 17 Apr 2025 11:16:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=98=E5=9C=A8fmlog=E6=97=B6?= =?UTF-8?q?=E5=B0=86route=E5=B8=A6=E7=BB=99mlog=E5=B9=B6=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E7=89=A9=E6=96=99=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 28311394..febe52e6 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -542,6 +542,7 @@ class MlogSerializer(CustomModelSerializer): raise ParseError('未提供消耗的车间物料') attrs['mgroup'] = fmlog.mgroup attrs['mtask'] = fmlog.mtask + attrs['route'] = fmlog.route attrs['mtype'] = fmlog.mgroup.mtype if attrs['mtask'] and attrs['mtask'].route: attrs['route'] = attrs['mtask'].route @@ -553,8 +554,8 @@ class MlogSerializer(CustomModelSerializer): pass else: raise ParseError('非合格品不可使用') - if wm_in.material != attrs['mtask'].material_in: - raise ParseError('消耗物料与任务不一致') + if wm_in.material != attrs['route'].material_in: + raise ParseError('消耗物料与工艺步骤不一致') if attrs['mtype'] == Mlog.MTYPE_OUT: supplier = attrs.get('supplier', None) if not supplier: