一些bug修复
This commit is contained in:
parent
54023e8c89
commit
2d834246fa
|
@ -98,7 +98,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
for index, i in enumerate(subps):
|
for index, i in enumerate(subps):
|
||||||
steps = Step.objects.filter(usedstep__subproduction=i, usedstep__subproduction__is_deleted=False,
|
steps = Step.objects.filter(usedstep__subproduction=i, usedstep__subproduction__is_deleted=False,
|
||||||
usedstep__is_deleted=False, is_deleted=False
|
usedstep__is_deleted=False, is_deleted=False
|
||||||
).values('id', 'number', 'name', 'usedstep__remark', need_test=F('usedstep__need_test'))
|
).order_by('number').values('id', 'number', 'name', 'usedstep__remark', need_test=F('usedstep__need_test'))
|
||||||
instance = SubProductionPlan.objects.create(production_plan=production_plan, subproduction=i,
|
instance = SubProductionPlan.objects.create(production_plan=production_plan, subproduction=i,
|
||||||
start_date=production_plan.start_date, end_date=production_plan.end_date,
|
start_date=production_plan.start_date, end_date=production_plan.end_date,
|
||||||
workshop=i.process.workshop, process=i.process, create_by=request.user,
|
workshop=i.process.workshop, process=i.process, create_by=request.user,
|
||||||
|
|
|
@ -64,6 +64,8 @@ class PickSerializer(serializers.Serializer):
|
||||||
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_OUT,
|
fifo = FIFO.objects.create(type=FIFO.FIFO_TYPE_DO_OUT,
|
||||||
inout_date=timezone.now(), create_by=self.context['request'].user,
|
inout_date=timezone.now(), create_by=self.context['request'].user,
|
||||||
number = 'CK' + ranstr(7))
|
number = 'CK' + ranstr(7))
|
||||||
|
if len(picks)<=0:
|
||||||
|
raise exceptions.APIException('没有领料项目')
|
||||||
for i in picks:
|
for i in picks:
|
||||||
isLowLevel = False
|
isLowLevel = False
|
||||||
# 更新出库详情
|
# 更新出库详情
|
||||||
|
@ -116,8 +118,9 @@ class PickSerializer(serializers.Serializer):
|
||||||
subproduction_plan=sp)
|
subproduction_plan=sp)
|
||||||
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() #实际开工日期
|
if sp.start_date_real is None:
|
||||||
sp.save()
|
sp.start_date_real = timezone.now()#实际开工日期
|
||||||
|
sp.save()
|
||||||
# 创建领料记录
|
# 创建领料记录
|
||||||
pick = Pick()
|
pick = Pick()
|
||||||
pick.subproduction_plan = sp
|
pick.subproduction_plan = sp
|
||||||
|
|
Loading…
Reference in New Issue