From aeed19db739fdef16f80304705e655a603488206 Mon Sep 17 00:00:00 2001 From: Alvaro Gouvea <44756822+AlGouvea@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:28:52 -0300 Subject: [PATCH] Issue2266 - Adiciona Campo de Autoria no Forms de Documento Administrativo (#3482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adicionado autor do documento administrativo * Migration de verbose_name Autoria do Documento * Pequenas alterações nos models e layout de protocoloadm Co-authored-by: Gustavo Santos --- sapl/protocoloadm/forms.py | 5 +++-- .../migrations/0039_auto_20211201_1201.py | 19 +++++++++++++++++++ sapl/protocoloadm/models.py | 2 +- sapl/templates/protocoloadm/layouts.yaml | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 sapl/protocoloadm/migrations/0039_auto_20211201_1201.py diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index 0d938480d..1d70d3a31 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -1089,7 +1089,8 @@ class DocumentoAdministrativoForm(FileFieldCheckMixin, ModelForm): 'restrito', 'user', 'ip', - 'ultima_edicao' + 'ultima_edicao', + 'autor' ] widgets = {'protocolo': forms.HiddenInput(), @@ -1210,7 +1211,7 @@ class DocumentoAdministrativoForm(FileFieldCheckMixin, ModelForm): [('tipo', 3), ('numero', 3), ('complemento', 3), ('ano', 3)]) row2 = to_row( - [('data', 4), ('numero_protocolo', 4), ('ano_protocolo', 4)]) + [('data', 3), ('numero_protocolo', 3), ('ano_protocolo', 3), ('autor', 3)]) row3 = to_row( [('assunto', 12)]) diff --git a/sapl/protocoloadm/migrations/0039_auto_20211201_1201.py b/sapl/protocoloadm/migrations/0039_auto_20211201_1201.py new file mode 100644 index 000000000..773557f59 --- /dev/null +++ b/sapl/protocoloadm/migrations/0039_auto_20211201_1201.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.24 on 2021-12-01 15:01 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0038_auto_20211025_1657'), + ] + + operations = [ + migrations.AlterField( + model_name='documentoadministrativo', + name='autor', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor', verbose_name='Autoria'), + ), + ] diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index dbf61af2d..9b1a65d85 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -175,7 +175,7 @@ class DocumentoAdministrativo(models.Model): interessado = models.CharField( max_length=50, blank=True, verbose_name=_('Interessado')) autor = models.ForeignKey(Autor, blank=True, null=True, - on_delete=models.PROTECT) + on_delete=models.PROTECT, verbose_name=_('Autoria')) dias_prazo = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Dias Prazo')) data_fim_prazo = models.DateField( diff --git a/sapl/templates/protocoloadm/layouts.yaml b/sapl/templates/protocoloadm/layouts.yaml index ef65a3212..7bf96372f 100644 --- a/sapl/templates/protocoloadm/layouts.yaml +++ b/sapl/templates/protocoloadm/layouts.yaml @@ -9,7 +9,7 @@ DocumentoAdministrativo: - numero complemento ano - data protocolo - assunto - - interessado tramitacao + - interessado autor tramitacao - texto_integral|urlize - documento_anexado_set__documento_principal|m2m_urlize_for_detail - documento_principal_set__documento_anexado|m2m_urlize_for_detail