peuvent tout voir.
"""
+ # On s'assure que le manager travaille sur un modèle avec WF, autrement
+ # on ne teste pas sur l'état
+ try:
+ self.model._meta.get_field_by_name('etat')
+ workflowed_model = True
+ except:
+ workflowed_model = False
+
employe = get_employe_from_user(user)
############################################
############################################
# TRAITEMENT POLE FINANCIER
############################################
- if grp_pole_financier in user.groups.all():
+ if workflowed_model and grp_pole_financier in user.groups.all():
liste = self.get_query_set().filter(etat=POSTE_ETAT_FINANCE)
############################################
# TRAITEMENT HAUTE DIRECTION
############################################
- if grp_haute_direction in user.groups.all():
+ if workflowed_model and grp_haute_direction in user.groups.all():
liste = self.get_query_set().filter(etat=POSTE_ETAT_HAUTE_DIRECTION)
############################################