diff --git a/models/scop_partner_staff.py b/models/scop_partner_staff.py index bc08dee0b755dc72b36c73eb5b805b96b0bf1706..6d76ae562240ac639dedd947bef909d31bfb5086 100644 --- a/models/scop_partner_staff.py +++ b/models/scop_partner_staff.py @@ -100,17 +100,17 @@ class ScopPartnerStaff(models.Model): """ Interdit de créer une ligne à 0 sauf lorsque cette ligne vient de la liste ministère - ou si ligne associés pour les SCIC + ou si ligne associés / ETP pour les SCIC ou si ligne ETP pour les 'tracked naf' """ if self.type_entry \ not in ('questionnaire', 'questionnaire_inscription'): if self.cooperative_form_id.id == self.env.ref( 'cgscop_partner.form_scic').id: - if self.staff_count == 0 or self.staff_average == 0: + if self.staff_count == 0: raise ValidationError( - "Les colonnes Effectif (EF) et Equivalents temps plein" - " (ETP) doivent être renseignés et supérieurs à 0.") + "La colonne Effectif (EF) doit être renseignée" + " et supérieurs à 0.") elif self.is_partner_in_tracked_naf: if self.staff_count == 0 or self.staff_shareholder_count == 0: raise ValidationError( diff --git a/views/res_partner.xml b/views/res_partner.xml index 7df4fe9727617e8891242dc46b254c7ab15f7c55..1faecbe8148af7c26d60a471269a31cdd1201a5b 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -703,7 +703,7 @@ <field name="type_entry" attrs="{'readonly':[('type_entry','in',('questionnaire', 'questionnaire_inscription'))]}"/> <field name="staff_count" attrs="{'readonly':[('type_entry','in',('questionnaire', 'questionnaire_inscription'))]}"/> <field name="staff_shareholder_count" attrs="{'readonly':[('type_entry','in',('questionnaire', 'questionnaire_inscription'))], 'required':[('cooperative_form_id', '!=', %(cgscop_partner.form_scic)d)]}"/> - <field name="staff_average" attrs="{'readonly':[('type_entry','in',('questionnaire', 'questionnaire_inscription'))], 'required':[('is_partner_in_tracked_naf', '!=', True)]}"/> + <field name="staff_average" attrs="{'readonly':[('type_entry','in',('questionnaire', 'questionnaire_inscription'))], 'required':[('is_partner_in_tracked_naf', '!=', True), ('cooperative_form_id', '!=', %(cgscop_partner.form_scic)d)]}"/> <field name="comment" /> <field name="user_id" readonly="1"/> <button name="edit_staff" type="object" icon="fa-pencil-square-o"/>