8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 03:43:12 +00:00

Minor typo fixes.

This commit is contained in:
David Sinquin 2017-07-18 23:57:57 +02:00
parent ff416f39b8
commit 5539c2e6fe
2 changed files with 8 additions and 5 deletions

View file

@ -45,9 +45,9 @@ class NewFactureForm(ModelForm):
cheque = cleaned_data.get("cheque") cheque = cleaned_data.get("cheque")
banque = cleaned_data.get("banque") banque = cleaned_data.get("banque")
if not paiement: if not paiement:
raise forms.ValidationError("Le moyen de paiement est obligatoire") raise forms.ValidationError("Le moyen de paiement est obligatoire.")
elif paiement.moyen.lower()=="chèque" or paiement.moyen.lower()=="cheque" and not (cheque and banque): elif paiement.moyen.lower()=="chèque" or paiement.moyen.lower()=="cheque" and not (cheque and banque):
raise forms.ValidationError("Le numero de chèque et la banque sont obligatoires") raise forms.ValidationError("Le numéro de chèque et la banque sont obligatoires.")
return cleaned_data return cleaned_data
class CreditSoldeForm(NewFactureForm): class CreditSoldeForm(NewFactureForm):
@ -90,7 +90,7 @@ class TrezEditFactureForm(EditFactureForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(TrezEditFactureForm, self).__init__(*args, **kwargs) super(TrezEditFactureForm, self).__init__(*args, **kwargs)
self.fields['valid'].label = 'Validité de la facture' self.fields['valid'].label = 'Validité de la facture'
self.fields['control'].label = 'Controle de la facture' self.fields['control'].label = 'Contrôle de la facture'
class ArticleForm(ModelForm): class ArticleForm(ModelForm):

View file

@ -107,8 +107,11 @@ class Article(models.Model):
name = models.CharField(max_length=255, unique=True) name = models.CharField(max_length=255, unique=True)
prix = models.DecimalField(max_digits=5, decimal_places=2) prix = models.DecimalField(max_digits=5, decimal_places=2)
iscotisation = models.BooleanField() iscotisation = models.BooleanField()
duration = models.IntegerField(validators=[MinValueValidator(0)], help_text="Durée exprimée en mois entiers", blank=True, null=True) duration = models.IntegerField(
help_text="Durée exprimée en mois entiers",
blank=True,
null=True,
min_value=0)
def clean(self): def clean(self):
if self.name.lower() == "solde": if self.name.lower() == "solde":