diff --git a/cotisations/models.py b/cotisations/models.py index d72ec60b..eec3b1e2 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -61,22 +61,16 @@ class NewFactureForm(ModelForm): class Meta: model = Facture - exclude = ['user', 'prix', 'name', 'valid'] + fields = ['paiement','banque','cheque','number'] + +class EditFactureForm(NewFactureForm): + class Meta(NewFactureForm.Meta): + fields = '__all__' -class EditFactureForm(ModelForm): def __init__(self, *args, **kwargs): super(EditFactureForm, self).__init__(*args, **kwargs) self.fields['user'].label = 'Adherent' - self.fields['number'].label = 'Quantité' - self.fields['cheque'].required = False - self.fields['banque'].required = False - self.fields['cheque'].label = 'Numero de chèque' self.fields['name'].label = 'Designation' self.fields['prix'].label = 'Prix unitaire' - self.fields['banque'].empty_label = "Non renseigné" - self.fields['paiement'].empty_label = "Séléctionner un moyen de paiement" self.fields['user'].empty_label = "Séléctionner l'adhérent propriétaire" - - class Meta: - model = Facture - fields = '__all__' + self.fields.pop('article')