modificar formato de pedimento completo, el formato que le da el datastage no coincide con el adecuado #25

Merged
jcedilloAS merged 1 commits from formato-pedimento-completo into main 2026-03-26 18:00:07 +00:00

View File

@@ -1920,9 +1920,9 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
tipo_documento = self.request.query_params.get('document_type') tipo_documento = self.request.query_params.get('document_type')
if tipo_documento: if tipo_documento:
if tipo_documento == '2': if tipo_documento == '2':
queryset = queryset.filter(archivo__startswith=f'documents/vu_PC_{pedimento.pedimento_app}.xml') queryset = queryset.filter(archivo__startswith=f'documents/vu_PC_')
elif tipo_documento == '3': # elif tipo_documento == '3':
queryset = queryset.filter(archivo__startswith=f'documents/vu_RM_{pedimento.pedimento_app}.xml') # queryset = queryset.filter(archivo__startswith=f'documents/vu_RM_')
else: else:
queryset = queryset.filter(archivo__startswith=f'documents/NOTFOUND_{pedimento.pedimento_app}.xml') queryset = queryset.filter(archivo__startswith=f'documents/NOTFOUND_{pedimento.pedimento_app}.xml')
@@ -1930,8 +1930,8 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
# Filtrar por tipos permitidos # Filtrar por tipos permitidos
# queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS) # queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
queryset = queryset.filter( queryset = queryset.filter(
Q(archivo__startswith=f'documents/vu_PC_{pedimento.pedimento_app}.xml') | Q(archivo__startswith=f'documents/vu_PC_')
Q(archivo__startswith=f'documents/vu_RM_{pedimento.pedimento_app}.xml') # Q(archivo__startswith=f'documents/vu_RM_')
) )
buscar_archivo = self.request.query_params.get('archivo__icontains') buscar_archivo = self.request.query_params.get('archivo__icontains')