fix: ftestwork_submit bug
This commit is contained in:
parent
096ad540d4
commit
e6e4a61289
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue