从半成品领料bug

This commit is contained in:
caoqianming 2021-11-18 16:49:22 +08:00
parent 8a41c1728e
commit b8495ee431
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class WProduct(CommonAModel):
production_plan = models.ForeignKey(ProductionPlan, verbose_name='关联主生产计划', on_delete=models.CASCADE)
warehouse = models.ForeignKey(WareHouse, verbose_name='所在仓库', on_delete=models.SET_NULL, null=True, blank=True)
# operation = models.ForeignKey('wpm.operation', verbose_name='关联操作',
# on_delete=models.SET_NULL, null=True, blank=True, related_name='')
# on_delete=models.SET_NULL, null=True, blank=True, related_name='current_operation')
class Operation(CommonADModel):
"""

View File

@ -56,7 +56,7 @@ class WPlanViewSet(ListModelMixin, GenericViewSet):
serializer= PickHalfSerializer(data=request.data, many=True)
serializer.is_valid(raise_exception=True)
vdata = serializer.data
first_step = Step.objects.get(pk=sp.steps[0].id)
first_step = Step.objects.get(pk=sp.steps[0]['id'])
for i in vdata:
if 'wproducts' in i and len(i['wproducts'])>0:
spp = SubProductionProgress.objects.get(pk=i['id'])