From fb156d125a90600b1d13a4c168fd0bc6b5be6408 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 20 Dec 2021 15:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E6=88=90=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/serializers.py | 1 + hb_server/apps/wpm/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/wpm/serializers.py b/hb_server/apps/wpm/serializers.py index dfc3102..bf91387 100644 --- a/hb_server/apps/wpm/serializers.py +++ b/hb_server/apps/wpm/serializers.py @@ -137,6 +137,7 @@ class WProductListSerializer(serializers.ModelSerializer): """ material_ = MaterialSimpleSerializer(source='material', read_only=True) step_ = StepSimpleSerializer(source='step', read_only=True) + subproduction_plan_ = SubproductionPlanSimpleSerializer(source='subproduction_plan', read_only=True) class Meta: model = WProduct fields = '__all__' diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index a9d6482..eb2e601 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -179,7 +179,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet): 半成品 """ perms_map={'*':'*'} - queryset = WProduct.objects.select_related('step', 'material').filter(is_hidden=False) + queryset = WProduct.objects.select_related('step', 'material', 'subproduction_plan').filter(is_hidden=False) serializer_class = WProductListSerializer filterset_fields = ['step', 'subproduction_plan', 'material', 'step__process', 'act_state', 'material__type'] search_fields = ['number']