mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 20:33:11 +00:00
Fix bug quand il n'y a pas d'articles
This commit is contained in:
parent
e5d559d4e4
commit
7935b6536c
1 changed files with 4 additions and 2 deletions
|
@ -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\
|
||||
.filter(type_paiement=1).first().id
|
||||
paiement_list = Paiement.objects.filter(type_paiement=1)
|
||||
if paiement_list:
|
||||
self.fields['paiement'].widget\
|
||||
.attrs['data-cheque'] = paiement_list.first().id
|
||||
|
||||
class Meta:
|
||||
model = Facture
|
||||
|
|
Loading…
Reference in a new issue