finance/statement: make allowance_to optional

If an excursion has zero admissable youth leaders, the statement and hence the excursion
currently can't be saved, because the `allowance_to` field has to be non-empty, but
the number of entries has to be zero. This commit hence makes the field optional.
pull/103/head
Christian Merten 11 months ago
parent 5d0aa18dde
commit 2e6bfc9b75
Signed by: christian.merten
GPG Key ID: D953D69721B948B3

@ -0,0 +1,19 @@
# Generated by Django 4.0.1 on 2025-01-18 22:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '0033_freizeit_approved_extra_youth_leader_count'),
('finance', '0006_statement_add_allowance_to_subsidy_to'),
]
operations = [
migrations.AlterField(
model_name='statement',
name='allowance_to',
field=models.ManyToManyField(blank=True, help_text='The youth leaders to which an allowance should be paid. The count must match the number of permitted youth leaders.', related_name='receives_allowance_for_statements', to='members.Member', verbose_name='Pay allowance to'),
),
]

@ -61,6 +61,7 @@ class Statement(CommonModel):
allowance_to = models.ManyToManyField(Member, verbose_name=_('Pay allowance to'), allowance_to = models.ManyToManyField(Member, verbose_name=_('Pay allowance to'),
related_name='receives_allowance_for_statements', related_name='receives_allowance_for_statements',
blank=True,
help_text=_('The youth leaders to which an allowance should be paid. The count must match the number of permitted youth leaders.')) help_text=_('The youth leaders to which an allowance should be paid. The count must match the number of permitted youth leaders.'))
subsidy_to = models.ForeignKey(Member, verbose_name=_('Pay subsidy to'), subsidy_to = models.ForeignKey(Member, verbose_name=_('Pay subsidy to'),
null=True, null=True,

Loading…
Cancel
Save