diff --git a/app/stiftung/forms.py b/app/stiftung/forms.py index 529de31..93d8059 100644 --- a/app/stiftung/forms.py +++ b/app/stiftung/forms.py @@ -1005,6 +1005,11 @@ class DestinataerUnterstuetzungForm(forms.ModelForm): self.is_auto_generated = True self.fields['faellig_am'].disabled = True self.fields['faellig_am'].help_text = "Fälligkeitsdatum wird automatisch basierend auf Quartal berechnet" + # Ensure the initial value is set for disabled field and widget shows the value + self.fields['faellig_am'].initial = self.instance.faellig_am + self.fields['faellig_am'].widget.attrs.update({ + 'value': self.instance.faellig_am.strftime('%Y-%m-%d') if self.instance.faellig_am else '' + }) def clean(self): cleaned_data = super().clean()