Merge pull request 'filtros de pedimento completo' (#26) from filtros-doctype into main
Reviewed-on: #26
This commit is contained in:
@@ -1919,18 +1919,13 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
||||
TIPOS_PERMITIDOS = ['2', '3'] # <-- Ajusta aquí tus tipos
|
||||
tipo_documento = self.request.query_params.get('document_type')
|
||||
if tipo_documento:
|
||||
if tipo_documento == '2':
|
||||
queryset = queryset.filter(archivo__startswith=f'documents/vu_PC_')
|
||||
# elif tipo_documento == '3':
|
||||
# queryset = queryset.filter(archivo__startswith=f'documents/vu_RM_')
|
||||
else:
|
||||
queryset = queryset.filter(archivo__startswith=f'documents/NOTFOUND_{pedimento.pedimento_app}.xml')
|
||||
|
||||
queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
||||
|
||||
else:
|
||||
# Filtrar por tipos permitidos
|
||||
# queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
||||
queryset = queryset.filter(
|
||||
Q(archivo__startswith=f'documents/vu_PC_')
|
||||
Q(archivo__istartswith=f'documents/vu_PC_')
|
||||
# Q(archivo__startswith=f'documents/vu_RM_')
|
||||
)
|
||||
|
||||
@@ -1948,6 +1943,7 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
||||
queryset = queryset.filter(pedimento__pedimento_app=pedimento_numero)
|
||||
|
||||
return queryset
|
||||
|
||||
class TriggerPedimentoCompletoView(APIView):
|
||||
"""
|
||||
Endpoint interno para disparar la descarga de pedimento completo
|
||||
|
||||
Reference in New Issue
Block a user