add autofocus

This commit is contained in:
2023-11-24 18:17:17 +00:00
parent 46d715d96e
commit 3f9e41a7e7
10 changed files with 22 additions and 2 deletions

View File

@@ -75,6 +75,8 @@ class BillCreateForm(forms.ModelForm):
self.fields["invoice"].rows = 3
# bank data fields
self.fields["payer"].autofocus = True
self.fields["name_text"].label = "Kontoinhaber:in"
self.fields["name_text"].required = False
@@ -221,6 +223,8 @@ class BillUpdateForm(forms.ModelForm):
if kwargs["instance"].status != "S":
self.fields["comment"].disabled = True
self.fields["comment"].autofocus = True
class ResolutionCreateForm(forms.ModelForm):
class Meta:
@@ -244,6 +248,11 @@ class ResolutionCreateForm(forms.ModelForm):
"date": DateInput(format=("%Y-%m-%d")),
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # to get the self.fields set
self.fields["option"].autofocus = True
class BillInlineForm(forms.ModelForm):
class Meta: