Make file modale chooser and complete user profile

This commit is contained in:
Skia
2016-08-11 04:24:32 +02:00
parent a8858fa781
commit 43b709bfd5
40 changed files with 850 additions and 177 deletions

View File

@ -53,7 +53,7 @@
{% endif %}
<td>{{ o.remark }}</td>
{% if o.invoice %}
<td><a href="{{ url('core:download') + '?file=' + o.invoice.name }}">{{ o.invoice.name }}</a></td>
<td><a href="{{ url('core:download', file_id=o.invoice.id) }}">{{ o.invoice.name }}</a></td>
{% else %}
<td>-</td>
{% endif %}

View File

@ -4,10 +4,9 @@ from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from django.forms.models import modelform_factory
from django.forms import HiddenInput
from django.forms.extras.widgets import SelectDateWidget
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin
from core.views.forms import SelectFile
from core.views.forms import SelectFile, SelectDate
from accounting.models import BankAccount, ClubAccount, GeneralJournal, Operation, AccountingType, Company
# Accounting types
@ -168,7 +167,7 @@ class OperationCreateView(CanCreateMixin, CreateView):
form_class = modelform_factory(Operation,
fields=['amount', 'label', 'remark', 'journal', 'target_type', 'target_id', 'target_label', 'date', 'mode',
'cheque_number', 'invoice', 'accounting_type', 'done'],
widgets={'journal': HiddenInput, 'date': SelectDateWidget})
widgets={'journal': HiddenInput, 'date': SelectDate})
template_name = 'core/create.jinja'
def get_initial(self):
@ -188,7 +187,7 @@ class OperationEditView(CanEditMixin, UpdateView):
form_class = modelform_factory(Operation,
fields = ['amount', 'label', 'remark', 'target_type', 'target_id', 'target_label', 'date', 'mode', 'cheque_number',
'invoice', 'accounting_type', 'done'],
widgets={'date': SelectDateWidget, 'invoice': SelectFile})
widgets={'date': SelectDate, 'invoice': SelectFile})
template_name = 'core/edit.jinja'
# Company views