From dd0d01c6b48a3de3437a6bc94ca07dfdd84219c8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 3 Nov 2025 14:17:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96gen=5Fnumber=5Fwith?= =?UTF-8?q?=5Frule=E7=9A=84m=5Fmodel=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/wpm/views.py b/apps/wpm/views.py index 456cded1..fe600205 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -949,10 +949,11 @@ class MlogbInViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, BulkDestroyMode c_year2 = str(c_year)[-2:] c_month = handle_date.month m_model = material_out.model - if m_model is None: - raise ParseError("生成编号出错:产品型号不能为空") - elif m_model and m_model.islower(): - raise ParseError("生成编号出错:产品型号不能为小写") + if 'm_model' in rule: + if m_model is None: + raise ParseError("生成编号出错:产品型号不能为空") + elif m_model and m_model.islower(): + raise ParseError("生成编号出错:产品型号不能为小写") # 按生产日志查询 wpr = ( Wpr.objects.filter(