From 219cb89368f7230a9a3e2393cbfd4a2833f8acda Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Fri, 9 Mar 2018 16:13:43 -0300 Subject: [PATCH] Edita etiqueta de protocolo (#1744) --- sapl/relatorios/views.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 30da38f8d..eace383dd 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -944,16 +944,22 @@ def get_etiqueta_protocolos(prots): dic['nom_autor'] = str(p.autor or ' ') + dic['num_materia'] = '' + for materia in MateriaLegislativa.objects.filter( + numero_protocolo=p.numero, ano=p.ano): + dic['num_materia'] = materia.tipo.sigla + ' ' + str(materia.numero) + '/' + str(materia.ano) + + dic['natureza'] = '' if p.tipo_processo == 0: dic['natureza'] = 'Administrativo' if p.tipo_processo == 1: - dic['natureza'] = 'Legislativo' + if dic['num_materia']: + dic['natureza'] = dic['num_materia'] + else: + dic['natureza'] = 'Legislativo' + - dic['num_materia'] = '' - for materia in MateriaLegislativa.objects.filter( - numero_protocolo=p.numero, ano=p.ano): - dic['num_materia'] = str(materia) dic['num_documento'] = '' for documento in DocumentoAdministrativo.objects.filter(