From af89b9a40ad5f52e7e408005e8a309b807a456c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Tue, 14 Jun 2022 16:11:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BB=88=E6=AD=A2=E5=92=8C?= =?UTF-8?q?=E6=9A=82=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/pm/serializers.py | 1 + hb_server/apps/wpm/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/pm/serializers.py b/hb_server/apps/pm/serializers.py index 4feced5..7351932 100644 --- a/hb_server/apps/pm/serializers.py +++ b/hb_server/apps/pm/serializers.py @@ -41,6 +41,7 @@ class ResourceCalListSerializer(serializers.ListSerializer): class SubProductionPlanListSerializer(DynamicFieldsSerializerMixin, serializers.ModelSerializer): workshop_ = OrganizationSimpleSerializer(source='workshop', read_only=True) + production_plan_ = ProductionPlanSimpleSerializer(source='production_plan', read_only=True) process_ = ProcessSimpleSerializer(source='process', read_only=True) subproduction_ = SubProductionSimpleSerializer(source='subproduction', read_only=True) product_ = MaterialSimpleSerializer(source='product', read_only=True) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index cd002ef..99d619c 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -49,7 +49,7 @@ class WPlanViewSet(ListModelMixin, GenericViewSet): """ perms_map = {'get': '*'} queryset = SubProductionPlan.objects.select_related( - 'process', 'workshop', 'subproduction', 'product').exclude(state=SubProductionPlan.SUBPLAN_STATE_PLANING) + 'process', 'workshop', 'subproduction', 'product', 'production_plan').exclude(state=SubProductionPlan.SUBPLAN_STATE_PLANING) search_fields = [] serializer_class = SubProductionPlanListSerializer filterset_fields = ['production_plan',