From 6165af7c4716bf57fa4e9bb3d0a59b4b46b6afdf Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 28 Dec 2023 17:28:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mlog=5Fsubmit=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=9B=B4=E8=AF=A6=E7=BB=86=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 4ee8af54..c9f9f46f 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -157,11 +157,14 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]): if count_x == 1: material_has = material_has_qs.first() elif count_x == 0: - raise ParseError(f'{material_in.name}-{mlog.batch}-批次库存不存在!') + raise ParseError( + f'{str(material_in)}-{mlog.batch}-批次库存不存在!') else: - raise ParseError(f'{material_in.name}-{mlog.batch}-存在多个相同批次!') + raise ParseError( + f'{str(material_in)}-{mlog.batch}-存在多个相同批次!') if mlog.count_use > material_has.count: - raise ParseError(f'{material_in.name}-{mlog.batch}-该批次车间库存不足!') + raise ParseError( + f'{str(material_in)}-{mlog.batch}-该批次车间库存不足!') else: material_has.count = material_has.count - mlog.count_use material_has.save()