Display default today date in new refund page

This commit is contained in:
Gabriel Augendre 2018-01-22 07:49:17 +01:00
parent 5f91aa9879
commit 81c954e662

View file

@ -1,3 +1,5 @@
import datetime
from bootstrap3_datetime.widgets import DateTimePicker
from django import forms
from django.db.models import Q
@ -19,6 +21,7 @@ class RefundForm(forms.ModelForm):
.objects\
.filter(Q(refund=None) | Q(refund=self.instance))\
.order_by('-date')
self.fields['date'].initial = datetime.date.today()
def save(self, *args, **kwargs):
# Save the refund