import project.rh.models as rh
from project.rh.forms import ContratForm, AyantDroitForm, EmployeAdminForm, \
AjaxSelect, DossierForm, ResponsableInlineForm
-
+
from project.rh.change_list import ChangeList
def _dossiers_postes(self, obj):
l = []
for d in obj.rh_dossiers.all().order_by('-date_debut'):
- actif = True
link_style = u''
list_style = u''
if d.date_fin is not None and d.date_fin < datetime.date.today():
- actif = False
link_style = u' style="color:#666;"'
list_style = u' style="color:grey;"'
-
+
dossier = u"""<a title="Aperçu du dossier"
href="%s"
onclick="return showAddAnotherPopup(this);"
link_style,
d.poste.nom,
d.poste.id)
-
+
link = u"""<li%s>%s %s</li>""" % \
(list_style, dossier, poste)
responsable = ''
try:
- dossier = obj.responsable.rh_dossiers.all().order_by('-date_debut')[0]
+ dossier = obj.responsable.rh_dossiers.all() \
+ .order_by('-date_debut')[0]
employe_id = dossier.employe.id
employe_html = u"""<br />
<a href="%s"
'responsable__employe__prenom',
)
ordering = ('nom',)
-
+
def _region(self, obj):
return obj.region.code
_region.short_description = u"Région"
_region.admin_order_field = 'region__code'
-
+
def _nom(self, obj):
return obj.nom
_nom.short_description = u"Implantation"
_nom.admin_order_field = 'nom'
-
+
def _responsable(self, obj):
try:
employe = obj.responsable.employe