半成品列表增加查询条件
This commit is contained in:
parent
199428c9ed
commit
fb156d125a
|
|
@ -137,6 +137,7 @@ class WProductListSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
material_ = MaterialSimpleSerializer(source='material', read_only=True)
|
material_ = MaterialSimpleSerializer(source='material', read_only=True)
|
||||||
step_ = StepSimpleSerializer(source='step', read_only=True)
|
step_ = StepSimpleSerializer(source='step', read_only=True)
|
||||||
|
subproduction_plan_ = SubproductionPlanSimpleSerializer(source='subproduction_plan', read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = WProduct
|
model = WProduct
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
||||||
半成品
|
半成品
|
||||||
"""
|
"""
|
||||||
perms_map={'*':'*'}
|
perms_map={'*':'*'}
|
||||||
queryset = WProduct.objects.select_related('step', 'material').filter(is_hidden=False)
|
queryset = WProduct.objects.select_related('step', 'material', 'subproduction_plan').filter(is_hidden=False)
|
||||||
serializer_class = WProductListSerializer
|
serializer_class = WProductListSerializer
|
||||||
filterset_fields = ['step', 'subproduction_plan', 'material', 'step__process', 'act_state', 'material__type']
|
filterset_fields = ['step', 'subproduction_plan', 'material', 'step__process', 'act_state', 'material__type']
|
||||||
search_fields = ['number']
|
search_fields = ['number']
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue