Ajout de la liste des affectations d'un employé
This commit is contained in:
@@ -418,6 +418,16 @@ def liste_employe(request):
|
||||
date_fin_daffectation__gte=timezone.now().date()
|
||||
)
|
||||
]
|
||||
toutes_affectations = [
|
||||
{
|
||||
"projet": affectation.projet.nom_projet,
|
||||
"role": dict(Affectation.ROLE_CHOICES).get(affectation.role, affectation.role),
|
||||
"pourcentage_temps_affectation": affectation.pourcentage_temps_affectation,
|
||||
"date_affectation": affectation.date_affectation,
|
||||
"date_fin_daffectation": affectation.date_fin_daffectation,
|
||||
}
|
||||
for affectation in Affectation.objects.filter(employe=employe).select_related("projet")
|
||||
]
|
||||
|
||||
data.append(
|
||||
{
|
||||
@@ -427,6 +437,7 @@ def liste_employe(request):
|
||||
"email": employe.user.email,
|
||||
"formations": formations,
|
||||
"affectations": affectations,
|
||||
"toutes_affectations": toutes_affectations,
|
||||
"projet": projets,
|
||||
"contrats": contrats,
|
||||
"departement": employe.departement.id if employe.departement else "",
|
||||
|
||||
Reference in New Issue
Block a user