From 5d2178d3670c023f537abc8831b19e0d133ec55b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 4 Aug 2026 16:34:27 -0300 Subject: [PATCH] Permite tornar um projeto extinto --- .../migrations/0039_projeto_extinto.py | 22 +++++++++++++++++++ sigi/apps/convenios/models.py | 9 +++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/convenios/migrations/0039_projeto_extinto.py diff --git a/sigi/apps/convenios/migrations/0039_projeto_extinto.py b/sigi/apps/convenios/migrations/0039_projeto_extinto.py new file mode 100644 index 0000000..8ee37c2 --- /dev/null +++ b/sigi/apps/convenios/migrations/0039_projeto_extinto.py @@ -0,0 +1,22 @@ +# Generated by Django 6.0.4 on 2026-08-04 15:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("convenios", "0038_projeto_termino_indefinido"), + ] + + operations = [ + migrations.AddField( + model_name="projeto", + name="extinto", + field=models.BooleanField( + default=False, + help_text="Indica se este projeto foi extinto e todos os convênios dele devem ser extintos também.", + verbose_name="extinto", + ), + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 8c9632c..9ce0ec9 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -63,6 +63,13 @@ class Projeto(models.Model): "uma data de término de vigência." ), ) + extinto = models.BooleanField( + _("extinto"), + default=False, + help_text=_( + "Indica se este projeto foi extinto e todos os convênios dele devem ser extintos também." + ), + ) texto_oficio = HTMLField( _("texto do ofício"), blank=True, help_text=OFICIO_HELP ) @@ -348,7 +355,7 @@ class Convenio(models.Model): if self.status and self.status.cancela: return _("Cancelado") - if self.data_extincao: + if self.data_extincao or self.projeto.extinto: return _("Extinto") if self.data_retorno_assinatura is not None: