Fix
[auf_rh_dae.git] / project / dae / views.py
index f9711d0..e61776a 100644 (file)
@@ -595,6 +595,12 @@ def embauche(request, key=None, dossier_id=None):
     for cmp_form in comparaisons_formset.forms:
         cmp_form.fields['implantation'].queryset = imp_qs
 
+    if dossier and dossier.poste:
+        dossier_form.fields['employe_anterieur'].queryset = (
+            dossier_form.fields['employe_anterieur'].queryset.filter(
+                rh_dossiers__poste=dossier.poste,
+                ).distinct()
+            )
 
     c = {
         'type_remun': filtered_type_remun(),