From e6e4a61289bb957cdac6c86b155dcb34f0f69731 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 12 Aug 2024 17:31:19 +0800 Subject: [PATCH] fix: ftestwork_submit bug --- apps/qm/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/qm/services.py b/apps/qm/services.py index 77f2b380..f304fd7a 100644 --- a/apps/qm/services.py +++ b/apps/qm/services.py @@ -8,13 +8,13 @@ from django.utils import timezone def ftestwork_submit(ins:FtestWork, user: User): wm:WMaterial = ins.wm # 更新对应的车间库存 - wm.count = wm.count - ins.count_notok + wm.count = wm.count - ins.count if wm.count >= 0: # 已检测的数量 wm.count_xtest = wm.count_xtest + ins.count wm.save() else: - raise ParseError("车间库存不足") + raise ParseError("超过待检数量") # 生成合格的 count_ok = ins.count_ok if count_ok > 0: