Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Expense report editing: Warn when the days total has changed

  • Loading branch information...
commit 0bc9a59092f27ffd4ab9a5002622439d2d15ada9 1 parent eab809d
@matthiask authored
View
245 migrations/0003_auto__add_field_expensereport_calculated_total_days.py
@@ -0,0 +1,245 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Adding field 'ExpenseReport.calculated_total_days'
+ db.add_column('zivinetz_expensereport', 'calculated_total_days', self.gf('django.db.models.fields.PositiveIntegerField')(default=0), keep_default=False)
+
+ def backwards(self, orm):
+
+ # Deleting field 'ExpenseReport.calculated_total_days'
+ db.delete_column('zivinetz_expensereport', 'calculated_total_days')
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 4, 12, 17, 48, 51, 760634)'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 4, 12, 17, 48, 51, 760509)'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'zivinetz.assessment': {
+ 'Meta': {'ordering': "['-created']", 'object_name': 'Assessment'},
+ 'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'drudge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'assessments'", 'to': "orm['zivinetz.Drudge']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mark': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'zivinetz.assignment': {
+ 'Meta': {'ordering': "['-date_from', '-date_until']", 'object_name': 'Assignment'},
+ 'arranged_on': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'date_from': ('django.db.models.fields.DateField', [], {}),
+ 'date_until': ('django.db.models.fields.DateField', [], {}),
+ 'date_until_extension': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'drudge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'assignments'", 'to': "orm['zivinetz.Drudge']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mobilized_on': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'part_of_long_assignment': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'regional_office': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.RegionalOffice']"}),
+ 'specification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.Specification']"}),
+ 'status': ('django.db.models.fields.IntegerField', [], {'default': '10'})
+ },
+ 'zivinetz.codeword': {
+ 'Meta': {'ordering': "['-created']", 'object_name': 'Codeword'},
+ 'codeword': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_index': 'True'})
+ },
+ 'zivinetz.companyholiday': {
+ 'Meta': {'ordering': "['date_from']", 'object_name': 'CompanyHoliday'},
+ 'date_from': ('django.db.models.fields.DateField', [], {}),
+ 'date_until': ('django.db.models.fields.DateField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+ },
+ 'zivinetz.compensationset': {
+ 'Meta': {'ordering': "['-valid_from']", 'object_name': 'CompensationSet'},
+ 'accomodation_home': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'breakfast_at_accomodation': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'breakfast_external': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'clothing': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '6'}),
+ 'clothing_limit_per_assignment': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'lunch_at_accomodation': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'lunch_external': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'private_transport_per_km': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'spending_money': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'supper_at_accomodation': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'supper_external': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
+ 'valid_from': ('django.db.models.fields.DateField', [], {'unique': 'True'})
+ },
+ 'zivinetz.drudge': {
+ 'Meta': {'ordering': "['user__last_name', 'user__first_name', 'zdp_no']", 'object_name': 'Drudge'},
+ 'address': ('django.db.models.fields.TextField', [], {}),
+ 'bank_account': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'date_of_birth': ('django.db.models.fields.DateField', [], {}),
+ 'driving_license': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'education_occupation': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'environment_course': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'general_abonnement': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'half_fare_card': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'health_insurance_account': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'health_insurance_company': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mobile': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
+ 'motor_saw_course': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'other_card': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'phone_home': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
+ 'phone_office': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
+ 'place_of_citizenship_city': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'place_of_citizenship_state': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
+ 'profile_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'regional_office': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.RegionalOffice']"}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
+ 'vegetarianism': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'zdp_no': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
+ 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '10'})
+ },
+ 'zivinetz.expensereport': {
+ 'Meta': {'ordering': "['assignment__drudge', 'date_from']", 'object_name': 'ExpenseReport'},
+ 'assignment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reports'", 'to': "orm['zivinetz.Assignment']"}),
+ 'calculated_total_days': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'clothing_expenses': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '10', 'decimal_places': '2'}),
+ 'clothing_expenses_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'date_from': ('django.db.models.fields.DateField', [], {}),
+ 'date_until': ('django.db.models.fields.DateField', [], {}),
+ 'forced_leave_days': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'forced_leave_days_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'free_days': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'free_days_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'holi_days': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'holi_days_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'miscellaneous': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '10', 'decimal_places': '2'}),
+ 'miscellaneous_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'report_no': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}),
+ 'sick_days': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'sick_days_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'status': ('django.db.models.fields.IntegerField', [], {'default': '10'}),
+ 'total': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '10', 'decimal_places': '2'}),
+ 'transport_expenses': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '10', 'decimal_places': '2'}),
+ 'transport_expenses_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'working_days': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'working_days_notes': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
+ },
+ 'zivinetz.expensereportperiod': {
+ 'Meta': {'ordering': "['date_from']", 'object_name': 'ExpenseReportPeriod'},
+ 'date_from': ('django.db.models.fields.DateField', [], {}),
+ 'expense_report': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'periods'", 'to': "orm['zivinetz.ExpenseReport']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'specification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.Specification']"})
+ },
+ 'zivinetz.jobreference': {
+ 'Meta': {'object_name': 'JobReference'},
+ 'assignment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobreferences'", 'to': "orm['zivinetz.Assignment']"}),
+ 'created': ('django.db.models.fields.DateField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'text': ('django.db.models.fields.TextField', [], {})
+ },
+ 'zivinetz.jobreferencetemplate': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'JobReferenceTemplate'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'text': ('django.db.models.fields.TextField', [], {}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'zivinetz.publicholiday': {
+ 'Meta': {'ordering': "['date']", 'object_name': 'PublicHoliday'},
+ 'date': ('django.db.models.fields.DateField', [], {'unique': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'zivinetz.regionaloffice': {
+ 'Meta': {'ordering': "['name']", 'object_name': 'RegionalOffice'},
+ 'address': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+ 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'})
+ },
+ 'zivinetz.scopestatement': {
+ 'Meta': {'ordering': "['name']", 'object_name': 'ScopeStatement'},
+ 'eis_no': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'zivinetz.specification': {
+ 'Meta': {'ordering': "['scope_statement', 'with_accomodation']", 'unique_together': "(('scope_statement', 'with_accomodation'),)", 'object_name': 'Specification'},
+ 'accomodation_free': ('django.db.models.fields.CharField', [], {'default': "'provided'", 'max_length': '20'}),
+ 'accomodation_sick': ('django.db.models.fields.CharField', [], {'default': "'provided'", 'max_length': '20'}),
+ 'accomodation_throughout': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'accomodation_working': ('django.db.models.fields.CharField', [], {'default': "'provided'", 'max_length': '20'}),
+ 'breakfast_free': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'breakfast_sick': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'breakfast_working': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'clothing': ('django.db.models.fields.CharField', [], {'default': "'provided'", 'max_length': '20'}),
+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+ 'conditions': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+ 'food_throughout': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'lunch_free': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'lunch_sick': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'lunch_working': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'scope_statement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'specifications'", 'to': "orm['zivinetz.ScopeStatement']"}),
+ 'supper_free': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'supper_sick': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'supper_working': ('django.db.models.fields.CharField', [], {'default': "'no_compensation'", 'max_length': '20'}),
+ 'with_accomodation': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
+ },
+ 'zivinetz.waitlist': {
+ 'Meta': {'ordering': "['created']", 'object_name': 'WaitList'},
+ 'assignment_date_from': ('django.db.models.fields.DateField', [], {}),
+ 'assignment_date_until': ('django.db.models.fields.DateField', [], {}),
+ 'assignment_duration': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'drudge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.Drudge']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'specification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['zivinetz.Specification']"})
+ }
+ }
+
+ complete_apps = ['zivinetz']
View
5 models.py
@@ -533,6 +533,7 @@ def generate_expensereports(self):
sick_days=0,
holi_days=0,
forced_leave_days=data['forced'],
+ calculated_total_days=data['working'] + data['free'] + data['forced'],
clothing_expenses=clothing_expenses,
)
@@ -588,6 +589,10 @@ class ExpenseReport(models.Model):
forced_leave_days = models.PositiveIntegerField(_('forced leave days'))
forced_leave_days_notes = models.CharField(_('notes'), max_length=100, blank=True)
+ calculated_total_days = models.PositiveIntegerField(_('calculated total days'),
+ help_text=_('This field is filled in automatically by the system and should not be changed.'),
+ default=0)
+
clothing_expenses = models.DecimalField(_('clothing expenses'),
max_digits=10, decimal_places=2, default=Decimal('0.00'))
clothing_expenses_notes = models.CharField(_('notes'), max_length=100, blank=True)
View
3  static/zivinetz/zivinetz.css
@@ -176,3 +176,6 @@ strong.warning {
form p {
margin-bottom: 5px;
}
+
+.box.error { background: #ea9e8f; }
+.box.warning { background: #ecd488; }
View
12 templates/zivinetz/expensereport_form.html
@@ -14,6 +14,18 @@
<form method="post" action=".">{% csrf_token %}
{% form_errors form formsets %}
+{% if form.warnings %}
+<div class="box warning cf">
+ {% for warning in form.warnings %}
+ {{ warning }}
+ {% endfor %}
+ <label for="{{ form.ignore_warnings.auto_id }}">
+ {{ form.ignore_warnings }}
+ {{ form.ignore_warnings.label }}
+ </label>
+</div>
+{% endif %}
+
<table>
{% if object %}
<tr>
View
29 views/modelviews.py
@@ -386,6 +386,30 @@ def post_save(self, request, instance, form, formset, change):
)
+class EditExpenseReportForm(forms.ModelForm, towel_forms.WarningsForm):
+ class Meta:
+ model = ExpenseReport
+ exclude = ('assignment', 'total', 'calculated_total_days')
+
+ def clean(self):
+ data = super(EditExpenseReportForm, self).clean()
+
+ try:
+ total_days = (data['working_days'] + data['free_days'] + data['sick_days']
+ + data['holi_days'] + data['forced_leave_days'])
+ except (ValueError, TypeError):
+ return data
+
+ if total_days != self.instance.calculated_total_days:
+ self.add_warning(
+ _('The number of days in this form (%(total)s) differs from the calculated number of days for this period (%(calculated)s).') % {
+ 'total': total_days,
+ 'calculated': self.instance.calculated_total_days,
+ })
+
+ return data
+
+
class ExpenseReportModelView(ZivinetzModelView):
paginate_by = 50
@@ -436,8 +460,7 @@ def deletion_allowed(self, request, instance):
def get_form(self, request, instance=None, change=None, **kwargs):
if instance and instance.pk:
- return super(ExpenseReportModelView, self).get_form(request, instance=instance,
- exclude=('assignment', 'total'))
+ return EditExpenseReportForm
else:
class ModelForm(forms.ModelForm):
assignment = forms.ModelChoiceField(
@@ -447,7 +470,7 @@ class ModelForm(forms.ModelForm):
class Meta:
model = self.model
- exclude = ('total',)
+ exclude = ('total', 'calculated_total_days')
formfield_callback = towel_forms.stripped_formfield_callback
Please sign in to comment.
Something went wrong with that request. Please try again.