diff --git a/tock/employees/admin.py b/tock/employees/admin.py index 43910648b..b3680483e 100644 --- a/tock/employees/admin.py +++ b/tock/employees/admin.py @@ -6,6 +6,8 @@ class UserDataForm(forms.ModelForm): + billable_expectation = forms.DecimalField(initial=0.80) + class Meta: model = UserData exclude = [] diff --git a/tock/hours/admin.py b/tock/hours/admin.py index 9f4ae3c81..0f90ba725 100644 --- a/tock/hours/admin.py +++ b/tock/hours/admin.py @@ -3,6 +3,7 @@ from django.contrib import admin from django.core.exceptions import ValidationError from django.forms.models import BaseInlineFormSet +from django.forms import DecimalField, ModelForm from .models import ( HolidayPrefills, @@ -77,11 +78,20 @@ class TimecardObjectInline(admin.TabularInline): ] +class TimecardAdminForm(ModelForm): + billable_expectation = DecimalField(initial=0.80) + + class Meta: + model = Timecard + fields = '__all__' + + class TimecardAdmin(admin.ModelAdmin): inlines = (TimecardObjectInline,) list_display = ('user', 'reporting_period', 'submitted') list_filter = (ReportingPeriodListFilter, 'reporting_period',) search_fields = ['user__username', 'reporting_period__start_date', 'reporting_period__end_date',] + form = TimecardAdminForm class TimecardNoteAdmin(admin.ModelAdmin):