diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 75af0e5..f4aac23 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -38,8 +38,9 @@ class ConvenioAdmin(admin.ModelAdmin): actions = ['delete_selected', 'relatorio'] inlines = (AnexosInline, EquipamentoPrevistoInline) list_display = ('id', 'casa_legislativa', - 'num_processo_sf', 'data_adesao', 'projeto') - list_filter = ('projeto','casa_legislativa') + 'num_processo_sf', 'data_adesao', 'projeto', + ) + list_filter = ('projeto','casa_legislativa','conveniada', 'equipada') date_hierarchy = 'data_adesao' ordering = ('-id',) raw_id_fields = ('casa_legislativa',) diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 60d64ef..54a46fb 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -63,7 +63,15 @@ class Convenio(models.Model): null=True, blank=True, ) - observacao = models.TextField() + observacao = models.TextField(null=True, blank=True) + conveniada = models.BooleanField() + equipada = models.BooleanField() + + def save(self, *args, **kwargs): + self.conveniada = self.data_retorno_assinatura!=None + self.equipada = self.data_termo_aceite!=None + super(Convenio, self).save(*args, **kwargs) + class Meta: get_latest_by = 'id'