领料bug
This commit is contained in:
parent
9bf2e94b53
commit
c0d8772a47
|
@ -57,7 +57,7 @@ class PickSerializer(serializers.Serializer):
|
||||||
i['count'] = len(i['iproducts'])
|
i['count'] = len(i['iproducts'])
|
||||||
isLowLevel = True
|
isLowLevel = True
|
||||||
if i['count']>0:
|
if i['count']>0:
|
||||||
if 'iproducts' in i:
|
if isLowLevel:
|
||||||
iproducts = i.pop('iproducts')
|
iproducts = i.pop('iproducts')
|
||||||
i['fifo'] = fifo
|
i['fifo'] = fifo
|
||||||
i['is_testok'] = True # 默认检测合格
|
i['is_testok'] = True # 默认检测合格
|
||||||
|
@ -91,12 +91,13 @@ class PickSerializer(serializers.Serializer):
|
||||||
spp.save()
|
spp.save()
|
||||||
if spp.count_pick > spp.count:
|
if spp.count_pick > spp.count:
|
||||||
raise exceptions.APIException('超过计划需求数')
|
raise exceptions.APIException('超过计划需求数')
|
||||||
# 更新半成品表
|
if isLowLevel:
|
||||||
wproducts = WProduct.objects.filter(pk__in=[x.wproduct for x in i['iproducts']])
|
# 更新半成品表
|
||||||
first_step = Step.objects.get(pk=sp.steps[0].id)
|
wproducts = WProduct.objects.filter(pk__in=[x.wproduct for x in i['iproducts']])
|
||||||
wproducts.update(step=first_step, is_executed=False,
|
first_step = Step.objects.get(pk=sp.steps[0].id)
|
||||||
act_state=WProduct.WPR_ACT_STATE_DOING, is_hidden=False, warehouse=None,
|
wproducts.update(step=first_step, is_executed=False,
|
||||||
subproduction_plan=sp, production_plan=sp.production_plan)
|
act_state=WProduct.WPR_ACT_STATE_DOING, is_hidden=False, warehouse=None,
|
||||||
|
subproduction_plan=sp, production_plan=sp.production_plan)
|
||||||
sp.is_picked=True
|
sp.is_picked=True
|
||||||
sp.state = SubProductionPlan.SUBPLAN_STATE_WORKING #生产中
|
sp.state = SubProductionPlan.SUBPLAN_STATE_WORKING #生产中
|
||||||
sp.state_date_real = timezone.now() #实际开工日期
|
sp.state_date_real = timezone.now() #实际开工日期
|
||||||
|
|
Loading…
Reference in New Issue