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: