diff --git a/apps/inm/services.py b/apps/inm/services.py index 41a7be60..0135fa02 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -288,9 +288,12 @@ class InmService: ddict["batch_ofrom"] = i.batch ddict["material_ofrom"] = i.material - count_change = i.count - i.count_notok if field == "count": + count_change = i.count - i.count_notok + elif field == "count_notok": count_change = getattr(i, field) + else: + raise ParseError("不支持该字段") m_list = [(material, warehouse, i.batch, count_change, None, i)] if tracking == Material.MA_TRACKING_SINGLE: