Fix for titulaire antérieur
authorBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Wed, 24 Apr 2013 14:56:57 +0000 (10:56 -0400)
committerBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Wed, 24 Apr 2013 14:56:57 +0000 (10:56 -0400)
project/dae/forms.py
project/dae/templates/dae/embauche.html
project/dae/views.py

index cdc80b3..614c81d 100644 (file)
@@ -770,7 +770,10 @@ class EmployeForm(forms.ModelForm):
         """ Mise à jour dynamique du contenu du menu des employés. """
         request = kwargs.pop('request', None)
         super(EmployeForm, self).__init__(*args, **kwargs)
         """ Mise à jour dynamique du contenu du menu des employés. """
         request = kwargs.pop('request', None)
         super(EmployeForm, self).__init__(*args, **kwargs)
-        self.fields['employe'].choices = _employe_choices(self, request)
+        self.fields['employe'].choices = _employe_choices(
+            self,
+            request,
+            )
 
 
 class DossierForm(
 
 
 class DossierForm(
index 11c4b73..06b98c0 100644 (file)
       <fieldset>
        <div>
           <div class="gauche"><h2>Proposition de classement</h2></div>
       <fieldset>
        <div>
           <div class="gauche"><h2>Proposition de classement</h2></div>
+         <div class="clear"></div>
           <div class="gauche">
             <table class="gauche">
                <tr>
           <div class="gauche">
             <table class="gauche">
                <tr>
            </table>
          </div>
        </div>
            </table>
          </div>
        </div>
+       <div class="clear"></div>
       {% include 'dae/embauche-remun.html' %}
 
       <!-- <select id="type-remun" name="type-remun"> -->
       {% include 'dae/embauche-remun.html' %}
 
       <!-- <select id="type-remun" name="type-remun"> -->
index 7277d8b..f5ae987 100644 (file)
@@ -596,12 +596,16 @@ def embauche(request, key=None, dossier_id=None):
         cmp_form.fields['implantation'].queryset = imp_qs
 
     # Comment out for now.
         cmp_form.fields['implantation'].queryset = imp_qs
 
     # Comment out for now.
-    # if dossier and dossier.poste:
-    #     dossier_form.fields['employe_anterieur'].queryset = (
-    #         dossier_form.fields['employe_anterieur'].queryset.filter(
-    #             rh_dossiers__poste=dossier.poste,
-    #             ).distinct()
-    #         )
+    try:
+        rh_poste = poste.id_rh
+    except rh.Poste.DoesNotExist:
+        rh_poste = None
+    if dossier and rh_poste:
+        dossier_form.fields['employe_anterieur'].queryset = (
+            dossier_form.fields['employe_anterieur'].queryset.filter(
+                rh_dossiers__poste__pk=rh_poste.pk,
+                ).distinct()
+            )
 
     c = {
         'type_remun': filtered_type_remun(),
 
     c = {
         'type_remun': filtered_type_remun(),