领料更新车间物料时只处理物料
This commit is contained in:
parent
20c70b3d11
commit
6f6707c024
|
@ -77,8 +77,8 @@ class StepViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
子工序-增删改查
|
子工序-增删改查
|
||||||
"""
|
"""
|
||||||
perms_map = {'get':'*', 'post':'step_create',
|
perms_map = {'get':'*', 'post':'process_update',
|
||||||
'put':'step_update', 'delete':'step_delete'}
|
'put':'process_update', 'delete':'process_update'}
|
||||||
queryset = Step.objects.all()
|
queryset = Step.objects.all()
|
||||||
serializer_class = StepSerializer
|
serializer_class = StepSerializer
|
||||||
search_fields = ['name', 'number']
|
search_fields = ['name', 'number']
|
||||||
|
|
|
@ -93,6 +93,7 @@ class PickSerializer(serializers.Serializer):
|
||||||
FIFOItemProduct.objects.bulk_create(mls)
|
FIFOItemProduct.objects.bulk_create(mls)
|
||||||
|
|
||||||
# 更新车间物料
|
# 更新车间物料
|
||||||
|
if i['material'].type != Material.MA_TYPE_HALFGOOD:
|
||||||
wm, _ = WMaterial.objects.get_or_create(material=i['material'], batch=i['batch'], \
|
wm, _ = WMaterial.objects.get_or_create(material=i['material'], batch=i['batch'], \
|
||||||
subproduction_plan=sp,defaults={
|
subproduction_plan=sp,defaults={
|
||||||
'material':i['material'],
|
'material':i['material'],
|
||||||
|
|
|
@ -281,6 +281,8 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
ip = {}
|
ip = {}
|
||||||
ip['fifoitem'] = fifoitem
|
ip['fifoitem'] = fifoitem
|
||||||
ip['wproduct'] = i
|
ip['wproduct'] = i
|
||||||
|
if i.number is None:
|
||||||
|
raise exceptions.APIException('缺少编号')
|
||||||
ip['number'] = i.number
|
ip['number'] = i.number
|
||||||
ip['material'] = i.material
|
ip['material'] = i.material
|
||||||
ips.append(FIFOItemProduct(**ip))
|
ips.append(FIFOItemProduct(**ip))
|
||||||
|
|
Loading…
Reference in New Issue