Display default today date in new refund page
This commit is contained in:
parent
5f91aa9879
commit
81c954e662
1 changed files with 3 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import datetime
|
||||||
|
|
||||||
from bootstrap3_datetime.widgets import DateTimePicker
|
from bootstrap3_datetime.widgets import DateTimePicker
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
@ -19,6 +21,7 @@ class RefundForm(forms.ModelForm):
|
||||||
.objects\
|
.objects\
|
||||||
.filter(Q(refund=None) | Q(refund=self.instance))\
|
.filter(Q(refund=None) | Q(refund=self.instance))\
|
||||||
.order_by('-date')
|
.order_by('-date')
|
||||||
|
self.fields['date'].initial = datetime.date.today()
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
# Save the refund
|
# Save the refund
|
||||||
|
|
Loading…
Reference in a new issue