diff --git a/eo_gestion/eo_facture/admin.py b/eo_gestion/eo_facture/admin.py index 28c6538..f95f1ef 100644 --- a/eo_gestion/eo_facture/admin.py +++ b/eo_gestion/eo_facture/admin.py @@ -282,7 +282,7 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin): if obj.periodicite: fields = [field for field in fields if field != 'percentage_per_year'] elif obj.percentage_per_year and len(obj.percentage_per_year) > 1: - fields = [field for field in fields if field != 'periodicite'] + fields = [field for field in fields if 'periodicite' not in field] return fields diff --git a/eo_gestion/eo_facture/models.py b/eo_gestion/eo_facture/models.py index d987e01..daf65c6 100644 --- a/eo_gestion/eo_facture/models.py +++ b/eo_gestion/eo_facture/models.py @@ -122,7 +122,9 @@ class Contrat(models.Model): creation = models.DateField(default=today) creator = models.ForeignKey(User, verbose_name='Créateur', on_delete=models.CASCADE) percentage_per_year = fields.PercentagePerYearField( - default=one_hundred_percent_this_year, verbose_name='Pourcentage par année' + default=one_hundred_percent_this_year, + verbose_name='Pourcentage par année', + help_text='Incompatible avec la périodicité', ) montant_sous_traite = models.DecimalField(max_digits=8, decimal_places=2, default=Decimal('0')) image = models.ImageField('Image', upload_to='images/', blank=True, null=True)