Skip to content

Commit

Permalink
Merge pull request #1111 from 18F/multiple-edit-timecards
Browse files Browse the repository at this point in the history
Multiple edit timecards - in-line edits for fields used in utilization calculations
  • Loading branch information
Jkrzy committed Jun 18, 2020
2 parents 918b107 + 2f1c3d3 commit a6f476a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tock/hours/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ class Meta:

class TimecardAdmin(admin.ModelAdmin):
inlines = (TimecardObjectInline,)
list_display = ('user', 'reporting_period', 'submitted')
list_display = ('user', 'reporting_period', 'billable_expectation', 'organization', 'submitted')
list_editable = ('organization', 'billable_expectation')
list_filter = (ReportingPeriodListFilter, 'reporting_period',)
search_fields = ['user__username', 'reporting_period__start_date', 'reporting_period__end_date',]
form = TimecardAdminForm
Expand Down
20 changes: 20 additions & 0 deletions tock/hours/migrations/0059_auto_20200618_1041.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.13 on 2020-06-18 14:41

from decimal import Decimal
import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('hours', '0058_auto_20200512_1510'),
]

operations = [
migrations.AlterField(
model_name='timecard',
name='billable_expectation',
field=models.DecimalField(decimal_places=2, default=Decimal('0.8000000000000000444089209850062616169452667236328125'), max_digits=3, validators=[django.core.validators.MaxValueValidator(limit_value=1)], verbose_name='Percent hours billable per week'),
),
]
2 changes: 1 addition & 1 deletion tock/hours/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class Timecard(models.Model):
modified = models.DateTimeField(auto_now=True)
billable_expectation = models.DecimalField(validators=[MaxValueValidator(limit_value=1)],
default=Decimal(settings.DEFAULT_BILLABLE_EXPECTATION), decimal_places=2, max_digits=3,
verbose_name="Percentage of hours which are expected to be billable this week")
verbose_name="Percent hours billable per week")

organization = models.ForeignKey(Organization, null=True, blank=True, on_delete=models.CASCADE)
unit = models.ForeignKey(Unit, null=True, blank=True, on_delete=models.CASCADE)
Expand Down

0 comments on commit a6f476a

Please sign in to comment.