From 8b0c2a185f1006631e6d64627e9fea363feb40a7 Mon Sep 17 00:00:00 2001 From: Edward <9326037+edwardoliveira@users.noreply.github.com> Date: Tue, 9 Feb 2021 10:56:35 -0300 Subject: [PATCH] Fix #3339 (#3341) Co-authored-by: eribeiro --- .../migrations/0027_auto_20210209_1047.py | 17 +++++++++++++++++ sapl/comissoes/models.py | 2 +- .../migrations/0077_auto_20210209_1047.py | 17 +++++++++++++++++ sapl/materia/models.py | 2 +- .../migrations/0037_auto_20210209_1047.py | 17 +++++++++++++++++ sapl/protocoloadm/models.py | 2 +- 6 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 sapl/comissoes/migrations/0027_auto_20210209_1047.py create mode 100644 sapl/materia/migrations/0077_auto_20210209_1047.py create mode 100644 sapl/protocoloadm/migrations/0037_auto_20210209_1047.py diff --git a/sapl/comissoes/migrations/0027_auto_20210209_1047.py b/sapl/comissoes/migrations/0027_auto_20210209_1047.py new file mode 100644 index 000000000..09efbf0bf --- /dev/null +++ b/sapl/comissoes/migrations/0027_auto_20210209_1047.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.13 on 2021-02-09 13:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0026_auto_20201009_0950'), + ] + + operations = [ + migrations.AlterModelOptions( + name='documentoacessorio', + options={'ordering': ('data', 'id'), 'verbose_name': 'Documento Acessório', 'verbose_name_plural': 'Documentos Acessórios'}, + ), + ] diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 7bc24020f..4bb1aa535 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -345,7 +345,7 @@ class DocumentoAcessorio(models.Model): class Meta: verbose_name = _('Documento Acessório') verbose_name_plural = _('Documentos Acessórios') - ordering = ('data', '-data_ultima_atualizacao') + ordering = ('data', 'id') def __str__(self): return _('%(nome)s por %(autor)s') % { diff --git a/sapl/materia/migrations/0077_auto_20210209_1047.py b/sapl/materia/migrations/0077_auto_20210209_1047.py new file mode 100644 index 000000000..0bdd2c53b --- /dev/null +++ b/sapl/materia/migrations/0077_auto_20210209_1047.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.13 on 2021-02-09 13:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0076_auto_20210107_1408'), + ] + + operations = [ + migrations.AlterModelOptions( + name='documentoacessorio', + options={'ordering': ('data', 'id'), 'verbose_name': 'Documento Acessório', 'verbose_name_plural': 'Documentos Acessórios'}, + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index d14b44d1d..c904974ad 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -568,7 +568,7 @@ class DocumentoAcessorio(models.Model): class Meta: verbose_name = _('Documento Acessório') verbose_name_plural = _('Documentos Acessórios') - ordering = ('data', '-data_ultima_atualizacao') + ordering = ('data', 'id') def __str__(self): return _('%(tipo)s - %(nome)s de %(data)s por %(autor)s') % { diff --git a/sapl/protocoloadm/migrations/0037_auto_20210209_1047.py b/sapl/protocoloadm/migrations/0037_auto_20210209_1047.py new file mode 100644 index 000000000..f9c313fba --- /dev/null +++ b/sapl/protocoloadm/migrations/0037_auto_20210209_1047.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.13 on 2021-02-09 13:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0036_auto_20210107_1408'), + ] + + operations = [ + migrations.AlterModelOptions( + name='documentoacessorioadministrativo', + options={'ordering': ('data', 'id'), 'verbose_name': 'Documento Acessório', 'verbose_name_plural': 'Documentos Acessórios'}, + ), + ] diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 6ddbb7eb7..5e6142f86 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -287,7 +287,7 @@ class DocumentoAcessorioAdministrativo(models.Model): class Meta: verbose_name = _('Documento Acessório') verbose_name_plural = _('Documentos Acessórios') - ordering = ('id',) + ordering = ('data', 'id') def __str__(self): return self.nome