Browse Source

Fix #176

pull/202/head
Edward Ribeiro 9 years ago
committed by Marcio Mazza
parent
commit
67195bb6b0
  1. 7
      protocoloadm/views.py

7
protocoloadm/views.py

@ -486,6 +486,10 @@ class ProtocoloDocumentoView(FormMixin, GenericView):
ano=date.today().year).aggregate(Max('numero'))
else:
numeracao = Protocolo.objects.all().aggregate(Max('numero'))
if numeracao is None:
numeracao['numero__max'] = 0
protocolo = Protocolo()
protocolo.numero = numeracao['numero__max'] + 1
protocolo.ano = datetime.now().year
@ -609,6 +613,9 @@ class ProtocoloMateriaView(FormMixin, GenericView):
else:
numeracao = Protocolo.objects.all().aggregate(Max('numero'))
if numeracao is None:
numero['numero__max'] = 0
protocolo = Protocolo()
protocolo.numero = numeracao['numero__max'] + 1

Loading…
Cancel
Save