mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-12 04:49:25 +00:00
Add nice whole file support
This commit is contained in:
@ -4,8 +4,10 @@ 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 accounting.models import BankAccount, ClubAccount, GeneralJournal, Operation, AccountingType, Company
|
||||
|
||||
# Accounting types
|
||||
@ -166,7 +168,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})
|
||||
widgets={'journal': HiddenInput, 'date': SelectDateWidget})
|
||||
template_name = 'core/create.jinja'
|
||||
|
||||
def get_initial(self):
|
||||
@ -183,8 +185,10 @@ class OperationEditView(CanEditMixin, UpdateView):
|
||||
"""
|
||||
model = Operation
|
||||
pk_url_kwarg = "op_id"
|
||||
fields = ['amount', 'label', 'remark', 'target_type', 'target_id', 'target_label', 'date', 'mode', 'cheque_number',
|
||||
'invoice', 'accounting_type', 'done']
|
||||
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})
|
||||
template_name = 'core/edit.jinja'
|
||||
|
||||
# Company views
|
||||
|
Reference in New Issue
Block a user