From c967d63db47b8f0c1d49ca84137ebd07f7292ff0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 18 Nov 2021 09:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E6=88=90=E5=93=81=E9=A2=86=E6=96=99bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/wpm/serializers.py b/hb_server/apps/wpm/serializers.py index a0c479e..040de52 100644 --- a/hb_server/apps/wpm/serializers.py +++ b/hb_server/apps/wpm/serializers.py @@ -93,7 +93,8 @@ class PickSerializer(serializers.Serializer): raise exceptions.APIException('超过计划需求数') if isLowLevel: # 更新半成品表 - wproducts = WProduct.objects.filter(pk__in=[x.wproduct for x in iproducts]) + wids = IProduct.objects.filter(pk__in=iproducts).values_list('wproduct', flat=True) + wproducts = WProduct.objects.filter(pk__in=wids) first_step = Step.objects.get(pk=sp.steps[0].id) wproducts.update(step=first_step, is_executed=False, act_state=WProduct.WPR_ACT_STATE_DOING, is_hidden=False, warehouse=None,