From 8697288d69991dd5242d07695c464fa706fcba12 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sun, 27 Apr 2025 12:17:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mlogbwcreate=E6=A0=A1=E9=AA=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0wm=E6=89=80=E5=B1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 8edd22c3..f85cce27 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -799,8 +799,11 @@ class MlogbwCreateUpdateSerializer(CustomModelSerializer): in_or_out, tracking = mlogb.get_tracking() if tracking != Material.MA_TRACKING_SINGLE: raise ParseError('非单件追踪不可使用') - if in_or_out == 'in' and not wpr: - raise ParseError('请选择相应产品') + if in_or_out == 'in': + if not wpr: + raise ParseError('请选择相应产品') + if mlogb.wm_in and wpr.wm != mlogb.wm_in: + raise ParseError(f'{wpr.number}-该产品非本批次') return attrs def save_ftest(self, mlogbw, ftest_data):