Add Order.custom_followup_at (#2124)

This commit is contained in:
Raphael Michel
2021-06-11 17:08:13 +02:00
committed by GitHub
parent 3235f90876
commit 97d67d58d5
14 changed files with 108 additions and 11 deletions

View File

@@ -205,6 +205,10 @@ class OrderFilterForm(FilterForm):
('na', _('Approved, payment pending')),
('pa', _('Approval pending')),
)),
(_('Follow-up date'), (
('custom_followup_at', _('Follow-up configured')),
('custom_followup_due', _('Follow-up due')),
)),
('testmode', _('Test mode')),
),
required=False,
@@ -324,6 +328,14 @@ class OrderFilterForm(FilterForm):
status=Order.STATUS_PENDING,
require_approval=False
)
elif s == 'custom_followup_at':
qs = qs.filter(
custom_followup_at__isnull=False
)
elif s == 'custom_followup_due':
qs = qs.filter(
custom_followup_at__lte=now().astimezone(get_current_timezone()).date()
)
elif s == 'testmode':
qs = qs.filter(
testmode=True

View File

@@ -230,12 +230,13 @@ class ExporterForm(forms.Form):
class CommentForm(I18nModelForm):
class Meta:
model = Order
fields = ['comment', 'checkin_attention']
fields = ['comment', 'checkin_attention', 'custom_followup_at']
widgets = {
'comment': forms.Textarea(attrs={
'rows': 3,
'class': 'helper-width-100',
}),
'custom_followup_at': DatePickerWidget(),
}