Commit 7935b653 authored by chirac's avatar chirac

Fix bug quand il n'y a pas d'articles

parent e5d559d4
......@@ -56,8 +56,10 @@ class NewFactureForm(ModelForm):
self.fields['banque'].empty_label = "Non renseigné"
self.fields['paiement'].empty_label = "Séléctionner\
un moyen de paiement"
self.fields['paiement'].widget.attrs['data-cheque'] = Paiement.objects\
paiement_list = Paiement.objects.filter(type_paiement=1)
if paiement_list:
.attrs['data-cheque'] = paiement_list.first().id
class Meta:
model = Facture
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment