From 6a51fd11773b32eceb7a023edc7e124806a3d88a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 18 Jul 2024 13:46:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=92=8Cmlogbin=20=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/filters.py | 3 ++- apps/wpm/serializers.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/wpm/filters.py b/apps/wpm/filters.py index ebad7086..50b2df05 100644 --- a/apps/wpm/filters.py +++ b/apps/wpm/filters.py @@ -47,7 +47,8 @@ class WMaterialFilter(filters.FilterSet): "batch": ["exact", "contains"], "mgroup": ["exact", "in", "isnull"], "mgroup__name": ["exact", "in"], - "count": ["gte", "lte", "exact"] + "count": ["gte", "lte", "exact"], + "notok_sign": ["exact", "in", "isnull"] } class MlogFilter(filters.FilterSet): diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 8c28541e..02dff1d6 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -368,6 +368,8 @@ class MlogbInSerializer(CustomModelSerializer): mlog: Mlog = attrs['mlog'] mtask: Mtask = attrs['mtask'] wm_in: WMaterial = attrs['wm_in'] + if wm_in.notok_sign is not None: + raise ValidationError('不合格物料不可使用') if mlog.route != mtask.route: raise ValidationError('工序不匹配') route = mlog.route