fix: 存在fmlog时将route带给mlog并进行物料校验
This commit is contained in:
parent
044b489388
commit
fafe39c1bd
|
@ -542,6 +542,7 @@ class MlogSerializer(CustomModelSerializer):
|
||||||
raise ParseError('未提供消耗的车间物料')
|
raise ParseError('未提供消耗的车间物料')
|
||||||
attrs['mgroup'] = fmlog.mgroup
|
attrs['mgroup'] = fmlog.mgroup
|
||||||
attrs['mtask'] = fmlog.mtask
|
attrs['mtask'] = fmlog.mtask
|
||||||
|
attrs['route'] = fmlog.route
|
||||||
attrs['mtype'] = fmlog.mgroup.mtype
|
attrs['mtype'] = fmlog.mgroup.mtype
|
||||||
if attrs['mtask'] and attrs['mtask'].route:
|
if attrs['mtask'] and attrs['mtask'].route:
|
||||||
attrs['route'] = attrs['mtask'].route
|
attrs['route'] = attrs['mtask'].route
|
||||||
|
@ -553,8 +554,8 @@ class MlogSerializer(CustomModelSerializer):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise ParseError('非合格品不可使用')
|
raise ParseError('非合格品不可使用')
|
||||||
if wm_in.material != attrs['mtask'].material_in:
|
if wm_in.material != attrs['route'].material_in:
|
||||||
raise ParseError('消耗物料与任务不一致')
|
raise ParseError('消耗物料与工艺步骤不一致')
|
||||||
if attrs['mtype'] == Mlog.MTYPE_OUT:
|
if attrs['mtype'] == Mlog.MTYPE_OUT:
|
||||||
supplier = attrs.get('supplier', None)
|
supplier = attrs.get('supplier', None)
|
||||||
if not supplier:
|
if not supplier:
|
||||||
|
|
Loading…
Reference in New Issue