Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple edit timecards - in-line edits for fields used in utilization calculations #1111

Merged
merged 7 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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