Browse Source

Fix #176

pull/202/head
Edward Ribeiro 9 years ago
parent
commit
544c231ecf
  1. 7
      protocoloadm/views.py

7
protocoloadm/views.py

@ -492,6 +492,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
@ -618,6 +622,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