Ajout de la liste des affectations d'un employé
All checks were successful
Organisation/sirh/pipeline/head This commit looks good
Organisation/sirh/pipeline/pr-main This commit looks good

This commit is contained in:
2026-10-08 15:08:32 +00:00
parent 0abbb26149
commit 0d2d3dddf7
5 changed files with 75 additions and 4 deletions

View File

@@ -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 "",