fix(cof_clubs): initial value for accounting period
This commit is contained in:
parent
ab1baba806
commit
afd381dab8
1 changed files with 7 additions and 1 deletions
|
@ -66,7 +66,13 @@ class ClubBudgetLineCommonForm(Form):
|
|||
accounting_period = forms.ModelChoiceField(
|
||||
label="Exercice comptable",
|
||||
queryset=ClubBudgetAccountingPeriod.objects.filter(is_archived=False),
|
||||
initial=ClubBudgetAccountingPeriod.objects.filter(is_archived=False).first(),
|
||||
empty_label=None,
|
||||
)
|
||||
label = forms.CharField(label="Libellé", max_length=1000)
|
||||
posted = forms.BooleanField(label="Transactions validées par la trez", initial=True)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["accounting_period"].initial = (
|
||||
ClubBudgetAccountingPeriod.objects.filter(is_archived=False).first()
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue