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,