Browse Source

Issue2266 - Adiciona Campo de Autoria no Forms de Documento Administrativo (#3482)

* 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 <gustavo@DESKTOP-JVUD0SL.localdomain>
pull/3499/head
Alvaro Gouvea 3 years ago
committed by GitHub
parent
commit
aeed19db73
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      sapl/protocoloadm/forms.py
  2. 19
      sapl/protocoloadm/migrations/0039_auto_20211201_1201.py
  3. 2
      sapl/protocoloadm/models.py
  4. 2
      sapl/templates/protocoloadm/layouts.yaml

5
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)])

19
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'),
),
]

2
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(

2
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

Loading…
Cancel
Save