From 6bcafcad3ab76e5ae90f28c019b6c15331c00269 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 17 Jan 2025 10:19:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=98=E6=9B=B4=E5=8D=95=E4=BB=B6?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E7=9A=84=E5=B1=9E=E6=80=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/services.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: