wproductticket list返回增加order product
This commit is contained in:
parent
895ffbe394
commit
7861b5419e
|
@ -12,6 +12,7 @@ from django.utils import timezone
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from apps.pm.serializers import SubproductionPlanSimpleSerializer
|
from apps.pm.serializers import SubproductionPlanSimpleSerializer
|
||||||
from apps.qm.models import TestRecord, TestRecordItem
|
from apps.qm.models import TestRecord, TestRecordItem
|
||||||
|
from apps.sam.serializers import OrderSimpleSerializer
|
||||||
from apps.system.serializers import UserSimpleSerializer
|
from apps.system.serializers import UserSimpleSerializer
|
||||||
from apps.wpm.models import Operation, OperationEquip, OperationMaterial, OperationWproduct, Pick, WMaterial, WProduct, OperationRecord, OperationRecordItem, WprouctTicket
|
from apps.wpm.models import Operation, OperationEquip, OperationMaterial, OperationWproduct, Pick, WMaterial, WProduct, OperationRecord, OperationRecordItem, WprouctTicket
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
@ -437,7 +438,10 @@ class WproductTicketListSerializer(serializers.ModelSerializer):
|
||||||
step_ = StepSimpleSerializer(source='step', read_only=True)
|
step_ = StepSimpleSerializer(source='step', read_only=True)
|
||||||
subproduction_plan_ = SubproductionPlanSimpleSerializer(source='subproduction_plan', read_only=True)
|
subproduction_plan_ = SubproductionPlanSimpleSerializer(source='subproduction_plan', read_only=True)
|
||||||
resp_process_ = ProcessSimpleSerializer(source='resp_process', read_only=True)
|
resp_process_ = ProcessSimpleSerializer(source='resp_process', read_only=True)
|
||||||
|
order_ = OrderSimpleSerializer(source='subproduction_plan.production_plan.order', read_only=True)
|
||||||
|
product_ = MaterialSimpleSerializer(source='subproduction_plan.production_plan.product', read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = WprouctTicket
|
model = WprouctTicket
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
|
@ -429,7 +429,8 @@ class WproductTicketViewSet(ListModelMixin, GenericViewSet):
|
||||||
玻璃审批工单
|
玻璃审批工单
|
||||||
"""
|
"""
|
||||||
perms_map={'*':'*'}
|
perms_map={'*':'*'}
|
||||||
queryset = WprouctTicket.objects.select_related('step', 'material', 'subproduction_plan', 'resp_process')
|
queryset = WprouctTicket.objects.select_related('step', 'material', 'subproduction_plan',
|
||||||
|
'resp_process', 'subproduction_plan__production_plan__order', 'subproduction_plan__production_plan')
|
||||||
serializer_class = WproductTicketListSerializer
|
serializer_class = WproductTicketListSerializer
|
||||||
filterset_fields = ['step', 'material', 'subproduction_plan', 'resp_process']
|
filterset_fields = ['step', 'material', 'subproduction_plan', 'resp_process']
|
||||||
ordering_fields = ['id']
|
ordering_fields = ['id']
|
||||||
|
|
Loading…
Reference in New Issue