From 075cb1b5926ee56ac169892054ac90aa86a04147 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 25 Mar 2020 00:25:24 +0100 Subject: [PATCH] Transaction can't be attached to a closed remittance --- apps/treasury/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/treasury/forms.py b/apps/treasury/forms.py index 8692791c..caaa365f 100644 --- a/apps/treasury/forms.py +++ b/apps/treasury/forms.py @@ -121,6 +121,8 @@ class LinkTransactionToRemittanceForm(forms.ModelForm): # Add submit button self.helper.add_input(Submit('submit', _("Submit"), attr={'class': 'btn btn-block btn-primary'})) + self.fields["remittance"].queryset = Remittance.objects.filter(closed=False) + def clean_last_name(self): """ Replace the first name in the information of the transaction.