[#3146] Ajouté les familles professionnelles
[auf_rh_dae.git] / project / rh / admin.py
CommitLineData
53ae644d
OL
1# -*- encoding: utf-8 -*-
2
53ae644d
OL
3import datetime
4
fc4bf968
EMS
5from ajax_select import make_ajax_form
6from auf.django.metadata.admin import \
7 AUFMetadataAdminMixin, AUFMetadataInlineAdminMixin, \
8 AUF_METADATA_READONLY_FIELDS
53ae644d 9from django.core.urlresolvers import reverse
50fa9bc1 10from django.contrib import admin
53ae644d
OL
11from django.conf import settings
12from django.db.models import Q
5f36f262 13from django.template.defaultfilters import date
fc4bf968
EMS
14
15import auf.django.references.models as ref
16import models as rh
17from forms import \
18 ContratForm, AyantDroitForm, EmployeAdminForm, AjaxSelect, DossierForm
53ae644d 19from dae.utils import get_employe_from_user
a17e2236 20from change_list import ChangeList
a12ddd52
OL
21from groups import grp_correspondants_rh
22from decorators import in_drh_or_admin
fc4bf968 23
82af5c19 24
7ba822a6
OL
25class ArchiveMixin(object):
26 """
27 Archive Mixin pour gérer le queryset et le display
28 NON COMPRIS : list_filter, et list_display, field à setter dans la classe.
29 """
30
31 def queryset(self, request):
32 return self.model._base_manager
33
34 def _archive(self, obj):
35 if obj.archive:
36 return "oui"
37 else:
38 return "non"
39 _archive.short_description = u'Archivé'
40 _archive.admin_order_field = 'archive'
41
fc4bf968 42
9da4c195
JPC
43class RegionProxy(ref.Region):
44 """ Proxy utilisé pour les organigrammes par région """
45 class Meta:
46 proxy = True
47 verbose_name = u"Organigramme par région"
48 verbose_name_plural = u"Organigramme par région"
49
50
82af5c19
JPC
51class ImplantationProxy(ref.Implantation):
52 """ Proxy utilisé pour les organigrammes par implantation """
53 class Meta:
54 proxy = True
55 verbose_name = u"Organigramme par implantations"
56 verbose_name_plural = u"Organigramme par implantations"
57
22343fe7 58
5c0f1778
JPC
59class ServiceProxy(rh.Service):
60 """ Proxy utilisé pour les organigrammes opar service """
61 class Meta:
62 proxy = True
63 verbose_name = u"Organigramme par services"
64 verbose_name_plural = u"Organigramme par services"
65
22343fe7 66
5c0f1778
JPC
67class EmployeProxy(rh.Employe):
68 """ Proxy utilisé pour les organigrammes des employés """
22343fe7
OL
69 class Meta:
70 proxy = True
71 verbose_name = u"Organigramme des employés"
72 verbose_name_plural = u"Organigramme des employés"
73
f614ca5c 74
40b35603 75class DateRangeMixin(object):
a17e2236 76 prefixe_recherche_temporelle = ""
22343fe7 77
40b35603 78 def get_changelist(self, request, **kwargs):
22343fe7 79 if 'HTTP_REFERER' in request.META.keys():
910e39e5
OL
80 referer = request.META['HTTP_REFERER']
81 referer = "/".join(referer.split('/')[3:])
82 referer = "/%s" % referer.split('?')[0]
22343fe7
OL
83 change_list_view = 'admin:%s_%s_changelist' % (
84 self.model._meta.app_label,
85 self.model.__name__.lower(),)
910e39e5
OL
86 if referer != reverse(change_list_view):
87 params = request.GET.copy()
22343fe7 88 params.update({'statut': 'Actif'})
910e39e5 89 request.GET = params
40b35603 90 return ChangeList
3195667e 91
22343fe7 92
53ae644d
OL
93# Override of the InlineModelAdmin to support the link in the tabular inline
94class LinkedInline(admin.options.InlineModelAdmin):
95 template = "admin/linked.html"
96 admin_model_path = None
97
98 def __init__(self, *args):
99 super(LinkedInline, self).__init__(*args)
100 if self.admin_model_path is None:
101 self.admin_model_path = self.model.__name__.lower()
102
103
104class ProtectRegionMixin(object):
105
106 def queryset(self, request):
53ae644d
OL
107 qs = super(ProtectRegionMixin, self).queryset(request)
108
53ae644d 109 user_groups = request.user.groups.all()
a12ddd52 110 if in_drh_or_admin(request.user):
53ae644d
OL
111 return qs
112
113 if grp_correspondants_rh in user_groups:
114 employe = get_employe_from_user(request.user)
22343fe7
OL
115 q = Q(**{self.model.prefix_implantation: \
116 employe.implantation.region})
53ae644d
OL
117 qs = qs.filter(q).distinct()
118 return qs
119 return qs.none()
120
c0be8705
OL
121 def has_add_permission(self, request):
122 if not in_drh_or_admin(request.user):
123 return False
124 else:
125 return True
126
53ae644d 127 def has_change_permission(self, request, obj=None):
20b4867c 128 user_groups = request.user.groups.all()
a0d365ed
OL
129
130 # Lock pour autoriser uniquement les DRH à utiliser RH
a12ddd52 131 if not in_drh_or_admin(request.user):
a0d365ed
OL
132 return False
133
a18bc295 134 if len(user_groups) == 0 and not request.user.is_superuser:
20b4867c
OL
135 return False
136
53ae644d
OL
137 if obj is None:
138 return True
139 ids = [o.id for o in self.queryset(request)]
140 return obj.id in ids
141
142
143# Inlines
144
145class ReadOnlyInlineMixin(object):
22343fe7 146
53ae644d 147 def get_readonly_fields(self, request, obj=None):
22343fe7
OL
148 return [f.name for f in self.model._meta.fields \
149 if f.name not in AUF_METADATA_READONLY_FIELDS]
53ae644d
OL
150
151
152class AyantDroitInline(AUFMetadataInlineAdminMixin, admin.StackedInline):
153 model = rh.AyantDroit
154 form = AyantDroitForm
155 extra = 0
156
157 fieldsets = (
158 (None, {
22343fe7
OL
159 'fields': (
160 ('nom', 'prenom'),
161 ('nom_affichage', 'genre'),
162 'nationalite',
163 'date_naissance',
164 'lien_parente',
165 )}),
53ae644d
OL
166 )
167
168
22343fe7
OL
169class AyantDroitCommentaireInline(AUFMetadataInlineAdminMixin, \
170 admin.TabularInline):
53ae644d
OL
171 readonly_fields = ('owner', )
172 model = rh.AyantDroitCommentaire
173 extra = 1
174
175
176class ContratInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
177 form = ContratForm
178 model = rh.Contrat
179 extra = 1
180
181
182class DossierROInline(ReadOnlyInlineMixin, LinkedInline):
183 template = "admin/rh/dossier/linked.html"
184 exclude = AUF_METADATA_READONLY_FIELDS
185 model = rh.Dossier
186 extra = 0
187 can_delete = False
188
189 def has_add_permission(self, request=None):
190 return False
191
192 def has_change_permission(self, request, obj=None):
193 return False
194
195 def has_delete_permission(self, request, obj=None):
196 return False
197
198
22343fe7
OL
199class DossierCommentaireInline(AUFMetadataInlineAdminMixin, \
200 admin.TabularInline):
53ae644d
OL
201 readonly_fields = ('owner', )
202 model = rh.DossierCommentaire
203 extra = 1
204
205
206class DossierPieceInline(admin.TabularInline):
207 model = rh.DossierPiece
208 extra = 4
209
210
211class EmployeInline(admin.TabularInline):
212 model = rh.Employe
213
22343fe7
OL
214
215class EmployeCommentaireInline(AUFMetadataInlineAdminMixin, \
216 admin.TabularInline):
53ae644d
OL
217 readonly_fields = ('owner', )
218 model = rh.EmployeCommentaire
219 extra = 1
220
221
222class EmployePieceInline(admin.TabularInline):
223 model = rh.EmployePiece
224 extra = 4
225
226
53ae644d
OL
227class PosteCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
228 readonly_fields = ('owner', )
229 model = rh.PosteCommentaire
230 extra = 1
231
232
233class PosteFinancementInline(admin.TabularInline):
234 model = rh.PosteFinancement
235
236
237class PostePieceInline(admin.TabularInline):
238 model = rh.PostePiece
239
240
241class RemunerationInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
242 model = rh.Remuneration
243 extra = 1
244
245
246class RemunerationROInline(ReadOnlyInlineMixin, RemunerationInline):
247 pass
248
249
250class TypePosteInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
251 model = rh.TypePoste
252
253
6f037929
OL
254class PosteComparaisonInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
255 model = rh.PosteComparaison
256
53ae644d
OL
257
258class ClassementAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 259 list_display = ('_classement', '_date_modification', 'user_modification', )
53ae644d
OL
260 fieldsets = AUFMetadataAdminMixin.fieldsets + (
261 (None, {
22343fe7 262 'fields': ('type', 'echelon', 'degre', 'coefficient',)}),
53ae644d
OL
263 )
264
c5964dc2
OL
265 def _classement(self, obj):
266 return unicode(obj)
267 _classement.short_description = u"Classement"
53ae644d 268
33232787 269 def _date_modification(self, obj):
22343fe7
OL
270 return date(obj.date_modification) \
271 if obj.date_modification is not None else "(aucune)"
33232787
JPC
272 _date_modification.short_description = u'date modification'
273 _date_modification.admin_order_field = 'date_modification'
274
22343fe7 275
53ae644d
OL
276class CommentaireAdmin(admin.ModelAdmin):
277 pass
278
279
7ba822a6 280class DeviseAdmin(AUFMetadataAdminMixin, admin.ModelAdmin, ArchiveMixin):
22343fe7
OL
281 list_display = (
282 'code',
283 'nom',
284 '_archive',
285 '_date_modification',
286 'user_modification',
287 )
edb35076 288 list_filter = ('archive', )
53ae644d
OL
289 fieldsets = AUFMetadataAdminMixin.fieldsets + (
290 (None, {
edb35076 291 'fields': ('code', 'nom', 'archive', ),
53ae644d
OL
292 }),
293 )
294
33232787 295 def _date_modification(self, obj):
22343fe7
OL
296 return date(obj.date_modification) \
297 if obj.date_modification is not None else "(aucune)"
33232787
JPC
298 _date_modification.short_description = u'date modification'
299 _date_modification.admin_order_field = 'date_modification'
53ae644d 300
22343fe7
OL
301
302class DossierAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
303 ProtectRegionMixin, admin.ModelAdmin, AjaxSelect,):
53ae644d 304 alphabet_filter = 'employe__nom'
22343fe7
OL
305 search_fields = (
306 'employe__nom',
307 'employe__prenom',
308 'poste__nom',
309 'poste__nom_feminin')
53ae644d
OL
310 list_display = (
311 '_id',
e49ac947
JPC
312 '_apercu',
313 '_nom',
53ae644d
OL
314 '_poste',
315 '_employe',
316 '_date_debut',
317 '_date_fin',
33232787 318 '_date_modification',
c5964dc2 319 'user_modification',
a47ed016 320 '_dae',
53ae644d 321 )
e49ac947 322 list_display_links = ('_nom',)
53ae644d
OL
323 list_filter = (
324 'poste__implantation__region',
325 'poste__implantation',
7bf28694 326 'poste__type_poste__categorie_emploi',
7baa5523 327 'poste__type_poste',
53ae644d 328 'rh_contrats__type_contrat',
6bee05ff 329 'principal',
53ae644d
OL
330 )
331 inlines = (DossierPieceInline, ContratInline,
332 RemunerationInline,
53ae644d
OL
333 DossierCommentaireInline,
334 )
335 fieldsets = AUFMetadataAdminMixin.fieldsets + (
336 (None, {
22343fe7
OL
337 'fields': (
338 'employe',
339 'poste',
6bee05ff 340 'principal',
22343fe7
OL
341 'statut',
342 'organisme_bstg',)}),
53ae644d 343 ('Recrutement', {
22343fe7
OL
344 'fields': (
345 'statut_residence',
346 'remplacement',
347 'remplacement_de', )}),
53ae644d 348 ('Rémunération', {
22343fe7
OL
349 'fields': (
350 'classement',
351 ('regime_travail', 'regime_travail_nb_heure_semaine'),)}),
53ae644d 352 ('Occupation du Poste par cet Employe', {
22343fe7
OL
353 'fields': (('date_debut', 'date_fin'), )}
354 ),
53ae644d 355 )
22343fe7
OL
356 form = make_ajax_form(rh.Dossier, {
357 'employe': 'employes',
358 'poste': 'postes',
359 'remplacement_de': 'dossiers',
6bee05ff 360 }, superclass=DossierForm)
53ae644d
OL
361
362 def lookup_allowed(self, key, value):
363 if key in (
364 'employe__nom__istartswith',
53ae644d
OL
365 'poste__implantation__region__id__exact',
366 'poste__implantation__id__exact',
367 'poste__type_poste__id__exact',
7bf28694 368 'poste__type_poste__categorie_emploi__id__exact',
53ae644d 369 'rh_contrats__type_contrat__id__exact',
6bee05ff
OL
370 'principal__exact',
371 'principal__isnull',
53ae644d
OL
372 ):
373 return True
374
e49ac947
JPC
375 def _id(self, obj):
376 return obj.id
377 _id.short_description = u"#"
378 _id.admin_order_field = "id"
379
380 def _nom(self, obj):
22343fe7
OL
381 return "%d : %s %s" % (
382 obj.date_debut.year,
383 obj.employe.nom.upper(),
384 obj.employe.prenom)
e49ac947
JPC
385 _nom.allow_tags = True
386 _nom.short_description = u"Dossier"
387
e49ac947 388 def _apercu(self, d):
22343fe7
OL
389 apercu_link = u"""<a title="Aperçu du dossier"
390 onclick="return showAddAnotherPopup(this);"
391 href='%s'>
392 <img src="%simg/loupe.png" />
393 </a>""" % \
b10920ea 394 (reverse('dossier_apercu', args=(d.id,)),
822a2c33 395 settings.STATIC_URL,
b10920ea 396 )
e49ac947
JPC
397 return apercu_link
398 _apercu.allow_tags = True
399 _apercu.short_description = u""
53ae644d 400
a47ed016
OL
401 def _dae(self, d):
402 apercu_link = ""
de151a1e
EMS
403 dossiers_dae = d.dossiers_dae.all()
404 if len(dossiers_dae) > 0:
405 dossier_dae = dossiers_dae[0]
a47ed016
OL
406 apercu_link = u"""<a title="Aperçu du dossier"
407 onclick="return showAddAnotherPopup(this);"
408 href='%s'>
409 <img src="%simg/loupe.png" />
410 </a>""" % \
de151a1e 411 (reverse('embauche_consulter', args=(dossier_dae.id,)),
a47ed016
OL
412 settings.STATIC_URL,
413 )
414 return apercu_link
415 _dae.allow_tags = True
416 _dae.short_description = u"DAE"
417
53ae644d 418 def _date_debut(self, obj):
5f36f262
OL
419 return date(obj.date_debut)
420
53ae644d
OL
421 _date_debut.short_description = u'Occupation début'
422 _date_debut.admin_order_field = 'date_debut'
423
424 def _date_fin(self, obj):
5f36f262 425 return date(obj.date_fin)
53ae644d
OL
426 _date_fin.short_description = u'Occupation fin'
427 _date_fin.admin_order_field = 'date_fin'
428
33232787 429 def _date_modification(self, obj):
22343fe7
OL
430 return date(obj.date_modification) \
431 if obj.date_modification is not None else "(aucune)"
33232787
JPC
432 _date_modification.short_description = u'date modification'
433 _date_modification.admin_order_field = 'date_modification'
434
53ae644d 435 def _poste(self, dossier):
22343fe7
OL
436 link = u"""<a title="Aperçu du poste"
437 onclick="return showAddAnotherPopup(this);"
438 href='%s'><img src="%simg/loupe.png" />
439 </a>
440 <a href="%s" title="Modifier le poste">%s</a>""" % \
53ae644d 441 (reverse('poste_apercu', args=(dossier.poste.id,)),
822a2c33 442 settings.STATIC_URL,
211a0e56
JPC
443 reverse('admin:rh_poste_change', args=(dossier.poste.id,)),
444 dossier.poste,
53ae644d
OL
445 )
446 return link
447 _poste.allow_tags = True
448 _poste.short_description = u'Poste'
449 _poste.admin_order_field = 'poste__nom'
450
451 def _employe(self, obj):
452 employe = obj.employe
453 view_link = reverse('employe_apercu', args=(employe.id,))
454 edit_link = reverse('admin:rh_employe_change', args=(employe.id,))
455
f614ca5c 456 style = ""
22343fe7
OL
457 view = u"""<a href="%s"
458 title="Aperçu l'employé"
459 onclick="return showAddAnotherPopup(this);">
460 <img src="%simg/loupe.png" />
461 </a>""" % (view_link, settings.STATIC_URL,)
e6c107de
JPC
462 return u"""%s<a href='%s' style="%s;">%s</a>""" % \
463 (view, edit_link, style, employe)
53ae644d 464 _employe.allow_tags = True
e49ac947 465 _employe.short_description = u"Employé"
53ae644d 466 _employe.admin_order_field = "employe__nom"
22343fe7 467
53ae644d
OL
468 def save_formset(self, request, form, formset, change):
469 instances = formset.save(commit=False)
470 for instance in instances:
471 if instance.__class__ == rh.DossierCommentaire:
472 instance.owner = request.user
02e69aa2 473 instance.date_creation = datetime.datetime.now()
53ae644d
OL
474 instance.save()
475
476
477class DossierPieceAdmin(admin.ModelAdmin):
478 pass
479
480
481class DossierCommentaireAdmin(admin.ModelAdmin):
482 pass
483
484
22343fe7
OL
485class EmployeAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
486 ProtectRegionMixin, admin.ModelAdmin,):
7eb6b687 487 prefixe_recherche_temporelle = "rh_dossiers__"
53ae644d
OL
488 alphabet_filter = 'nom'
489 DEFAULT_ALPHABET = u'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
490 search_fields = ('id', 'nom', 'prenom', 'nom_affichage', )
491 ordering = ('nom', )
492 form = EmployeAdminForm
22343fe7
OL
493 list_display = (
494 '_id',
495 '_apercu',
496 '_nom',
497 '_dossiers_postes',
498 '_date_modification',
499 'user_modification',
500 )
e49ac947 501 list_display_links = ('_nom',)
22343fe7
OL
502 list_filter = (
503 'rh_dossiers__poste__implantation__region',
504 'rh_dossiers__poste__implantation',
505 'nb_postes',
506 )
53ae644d
OL
507 inlines = (AyantDroitInline,
508 DossierROInline,
509 EmployePieceInline,
510 EmployeCommentaireInline)
511 fieldsets = AUFMetadataAdminMixin.fieldsets + (
512 ('Identification', {
22343fe7
OL
513 'fields': (
514 ('nom', 'prenom'),
515 ('nom_affichage', 'genre'),
516 'nationalite',
517 'date_naissance',
518 )}
519 ),
53ae644d 520 ('Informations personnelles', {
22343fe7
OL
521 'fields': ('situation_famille', 'date_entree', )}
522 ),
53ae644d 523 ('Coordonnées', {
22343fe7
OL
524 'fields': (
525 ('tel_domicile', 'tel_cellulaire'),
526 ('adresse', 'ville'),
527 ('code_postal', 'province'),
528 'pays',
529 )}
530 ),
53ae644d
OL
531 )
532
b10920ea 533 def _apercu(self, obj):
22343fe7
OL
534 return u"""<a title="Aperçu de l'employé"
535 onclick="return showAddAnotherPopup(this);"
536 href='%s'>
537 <img src="%simg/loupe.png" />
538 </a>""" % \
539 (reverse('employe_apercu', args=(obj.id,)), settings.STATIC_URL)
b10920ea
JPC
540 _apercu.allow_tags = True
541 _apercu.short_description = u""
b10920ea 542
53ae644d 543 def _nom(self, obj):
53ae644d 544 edit_link = reverse('admin:rh_employe_change', args=(obj.id,))
e6c107de 545 return u"""<a href='%s'><strong>%s</strong></a>""" % \
e49ac947 546 (edit_link, "%s %s" % (obj.nom.upper(), obj.prenom))
53ae644d 547 _nom.allow_tags = True
e49ac947 548 _nom.short_description = u"Employé"
53ae644d
OL
549 _nom.admin_order_field = "nom"
550
e49ac947
JPC
551 def _id(self, obj):
552 return obj.id
553 _id.short_description = u"#"
554 _id.admin_order_field = "id"
555
33232787 556 def _date_modification(self, obj):
22343fe7
OL
557 return date(obj.date_modification) \
558 if obj.date_modification is not None else "(aucune)"
33232787
JPC
559 _date_modification.short_description = u'date modification'
560 _date_modification.admin_order_field = 'date_modification'
561
a7f013f5 562 def _dossiers_postes(self, obj):
53ae644d
OL
563 l = []
564 for d in obj.rh_dossiers.all().order_by('-date_debut'):
22343fe7
OL
565 dossier = u"""<a title="Aperçu du dossier"
566 href="%s"
567 onclick="return showAddAnotherPopup(this);"
568 title="Aperçu du dossier">
569 <img src="%simg/loupe.png" />
570 </a>
571 <a href="%s">Dossier</a>
572 &nbsp;""" % \
573 (reverse('dossier_apercu', args=(d.id,)),
574 settings.STATIC_URL,
575 reverse('admin:rh_dossier_change', args=(d.id,)))
576
577 poste = u"""<a title="Aperçu du poste"
578 href="%s"
579 onclick="return showAddAnotherPopup(this);"
580 title="Aperçu du poste">
581 <img src="%simg/loupe.png" />
582 </a>
583 <a href="%s">Poste</a>
584 &nbsp;""" % \
585 (reverse('poste_apercu', args=(d.poste.id,)),
586 settings.STATIC_URL,
587 reverse('admin:rh_poste_change', args=(d.poste.id,)))
a7f013f5
JPC
588 link = u"""<li>%s %s - %s : [%s] %s</li>""" % \
589 (dossier, poste,
53ae644d 590 d.date_debut.year,
a7f013f5
JPC
591 d.poste.id,
592 d.poste.nom,
53ae644d 593 )
b5cc0357
OL
594
595 # Dossier terminé en gris non cliquable
a4329fae 596 if d.date_fin is not None and d.date_fin < datetime.date.today():
a7f013f5 597 link = u"""<li style="color: grey">%s : [%s] %s</li>""" % \
b5cc0357 598 (d.date_debut.year,
a7f013f5
JPC
599 d.poste.id,
600 d.poste.nom,
b5cc0357
OL
601 )
602
53ae644d
OL
603 l.append(link)
604 return "<ul>%s</ul>" % "\n".join(l)
a7f013f5
JPC
605 _dossiers_postes.allow_tags = True
606 _dossiers_postes.short_description = u"Dossiers et postes"
53ae644d
OL
607
608 def queryset(self, request):
22343fe7 609 qs = super(EmployeAdmin, self).queryset(request)
53ae644d
OL
610 return qs.select_related(depth=1).order_by('nom')
611
612 def save_formset(self, request, form, formset, change):
613 instances = formset.save(commit=False)
614 for instance in instances:
615 if instance.__class__ == rh.EmployeCommentaire:
616 instance.owner = request.user
02e69aa2 617 instance.date_creation = datetime.datetime.now()
53ae644d
OL
618 instance.save()
619
22343fe7 620
08faf06e 621class EmployeProxyAdmin(EmployeAdmin):
22343fe7 622 list_display = ('_id', '_apercu', '_nom', '_organigramme')
bd917a45
JPC
623 actions = None
624
625 def __init__(self, *args, **kwargs):
626 super(EmployeProxyAdmin, self).__init__(*args, **kwargs)
627 self.list_display_links = (None, )
08faf06e 628
22343fe7
OL
629 def has_add_permission(self, obj):
630 return False
631
08faf06e
JPC
632 def _organigramme(self, obj):
633 l = []
fc4bf968
EMS
634 for d in rh.Dossier.objects.filter(
635 Q(date_fin__gt=datetime.date.today()) | Q(date_fin=None),
636 Q(date_debut__lt=datetime.date.today()) | Q(date_debut=None),
637 employe=obj.id
638 ):
639 organigramme = \
640 u'Organigramme, niveau: ' \
641 u'<input type="text" id="level_%s" ' \
642 u'style="width:30px;height:15px;" /> ' \
643 u'<input type="button" value="Générer" ' \
644 u"""onclick="window.location='%s' + """ \
645 u"""document.getElementById('level_%s').value" />""" % (
646 d.poste.id,
647 reverse('rho_employe_sans_niveau', args=(d.poste.id,)),
648 d.poste.id
649 )
650 link = u"""<li>%s - [%s] %s : %s</li>""" % (
651 d.date_debut.year,
652 d.poste.id,
653 d.poste.nom,
654 organigramme
655 )
08faf06e
JPC
656 l.append(link)
657 return "<ul>%s</ul>" % "\n".join(l)
658
659 _organigramme.allow_tags = True
660 _organigramme.short_description = "Organigramme"
661
53ae644d 662
53ae644d
OL
663class EmployeCommentaireAdmin(admin.ModelAdmin):
664 pass
665
666
667class EmployePieceAdmin(admin.ModelAdmin):
668 pass
669
670
7bf28694 671class CategorieEmploiAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 672 list_display = ('nom', '_date_modification', 'user_modification', )
53ae644d 673 inlines = (TypePosteInline,)
22343fe7
OL
674 fieldsets = AUFMetadataAdminMixin.fieldsets + (
675 (None, {'fields': ('nom', )}),)
53ae644d 676
33232787 677 def _date_modification(self, obj):
22343fe7
OL
678 return date(obj.date_modification) \
679 if obj.date_modification is not None else "(aucune)"
33232787
JPC
680 _date_modification.short_description = u'date modification'
681 _date_modification.admin_order_field = 'date_modification'
53ae644d 682
22343fe7 683
95b630cf 684class OrganismeBstgAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 685 search_fields = ('nom',)
22343fe7
OL
686 list_display = (
687 'nom',
688 'type',
689 'pays',
690 '_date_modification',
691 'user_modification',
692 )
c5964dc2 693 list_filter = ('type', )
53ae644d 694 inlines = (DossierROInline,)
22343fe7
OL
695 fieldsets = AUFMetadataAdminMixin.fieldsets + (
696 (None, {'fields': ('nom', 'type', 'pays',)}),
53ae644d
OL
697 )
698
33232787 699 def _date_modification(self, obj):
22343fe7
OL
700 return date(obj.date_modification) \
701 if obj.date_modification is not None else "(aucune)"
33232787
JPC
702 _date_modification.short_description = u'date modification'
703 _date_modification.admin_order_field = 'date_modification'
704
53ae644d 705
22343fe7
OL
706class PosteAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
707 ProtectRegionMixin, admin.ModelAdmin, AjaxSelect,):
708 form = make_ajax_form(rh.Poste, {
709 'implantation': 'implantations',
710 'type_poste': 'typepostes',
711 'responsable': 'postes',
712 'valeur_point_min': 'valeurpoints',
713 'valeur_point_max': 'valeurpoints',
53ae644d
OL
714 })
715 alphabet_filter = 'nom'
22343fe7 716 search_fields = (
397bf8dd 717 'id',
22343fe7 718 'nom',
22343fe7
OL
719 'implantation__nom',
720 'implantation__region__code',
721 'implantation__region__nom',
722 'rh_dossiers__employe__nom',
723 'rh_dossiers__employe__prenom',
724 )
53ae644d 725 list_display = (
e49ac947 726 '_id',
8f3ca727 727 '_apercu',
22343fe7 728 '_nom',
53ae644d 729 '_occupe_par',
22343fe7
OL
730 'implantation',
731 '_service',
1ce2ddb9 732 '_responsable',
352fa696 733 'date_debut',
53ae644d 734 'date_fin',
33232787 735 '_date_modification',
53ae644d 736 'user_modification',
a47ed016 737 '_dae',
53ae644d 738 )
f614ca5c 739 list_filter = (
22343fe7 740 'implantation__region',
53ae644d 741 'implantation',
22343fe7 742 'service',
53ae644d 743 'type_poste',
7bf28694 744 'type_poste__categorie_emploi',
4c53dda4 745 'vacant',
53ae644d 746 )
e49ac947 747 list_display_links = ('_nom',)
53ae644d 748 fieldsets = AUFMetadataAdminMixin.fieldsets + (
22343fe7
OL
749 (None, {'fields': (
750 ('nom', 'nom_feminin'),
751 'implantation',
752 'type_poste',
753 'service',
754 'responsable',
755 )}
756 ),
53ae644d 757 ('Contrat', {
22343fe7
OL
758 'fields': ((
759 'regime_travail',
760 'regime_travail_nb_heure_semaine'),
761 )}
762 ),
53ae644d 763 ('Recrutement', {
22343fe7
OL
764 'fields': (('local', 'expatrie', 'mise_a_disposition', 'appel'),)}
765 ),
53ae644d 766 ('Rémunération', {
22343fe7
OL
767 'fields': (('classement_min',
768 'valeur_point_min',
769 'devise_min',
770 'salaire_min',
771 'indemn_min',
772 'autre_min',),
773 ('classement_max',
774 'valeur_point_max',
775 'devise_max',
776 'salaire_max',
777 'indemn_max',
778 'autre_max',),
779 )}),
53ae644d
OL
780 ('Comparatifs de rémunération', {
781 'fields': ('devise_comparaison',
782 ('comp_locale_min', 'comp_locale_max'),
783 ('comp_universite_min', 'comp_universite_max'),
784 ('comp_fonctionpub_min', 'comp_fonctionpub_max'),
785 ('comp_ong_min', 'comp_ong_max'),
22343fe7
OL
786 ('comp_autre_min', 'comp_autre_max'))}
787 ),
53ae644d 788 ('Justification', {
22343fe7
OL
789 'fields': ('justification',)}
790 ),
48a6df80 791 ('Autres Méta-données', {
22343fe7
OL
792 'fields': ('date_debut', 'date_fin')}
793 ),
53ae644d
OL
794 )
795
796 inlines = (PosteFinancementInline,
797 PostePieceInline,
798 DossierROInline,
6f037929 799 PosteComparaisonInline,
53ae644d
OL
800 PosteCommentaireInline, )
801
f614ca5c
OL
802 def lookup_allowed(self, key, value):
803 if key in (
804 'date_debut__gte',
805 'date_debut__isnull',
806 'date_fin__lte',
807 'date_fin__isnull',
7f4d1233
OL
808 'implantation__region__id__exact',
809 'implantation__id__exact',
810 'type_poste__id__exact',
7bf28694 811 'type_poste__categorie_emploi__id__exact',
7f4d1233 812 'service__id__exact',
d48f0922 813 'service__isnull',
7f4d1233 814 'vacant__exact',
c4a762e1 815 'vacant__isnull',
f614ca5c
OL
816 ):
817 return True
818
8f3ca727 819 def _apercu(self, poste):
22343fe7
OL
820 view_link = u"""<a onclick="return showAddAnotherPopup(this);"
821 title="Aperçu du poste"
822 href='%s'>
823 <img src="%simg/loupe.png" />
824 </a>""" % \
8f3ca727 825 (reverse('poste_apercu', args=(poste.id,)),
22343fe7
OL
826 settings.STATIC_URL,)
827 return view_link
8f3ca727 828 _apercu.allow_tags = True
e49ac947
JPC
829 _apercu.short_description = ''
830
a47ed016
OL
831 def _dae(self, poste):
832 apercu_link = ""
de151a1e
EMS
833 postes_dae = poste.postes_dae.all()
834 if len(postes_dae) > 0:
835 poste_dae = postes_dae[0]
836 apercu_link = \
837 u'<a title="Aperçu du dossier" href="%s" ' \
838 u'onclick="return showAddAnotherPopup(this);">' \
839 u'<img src="%simg/loupe.png" /></a>' % (reverse(
840 'poste_consulter', args=("dae-%s" % poste_dae.id,)
841 ), settings.STATIC_URL)
a47ed016
OL
842 return apercu_link
843 _dae.allow_tags = True
844 _dae.short_description = u"DAE"
845
e49ac947
JPC
846 def _id(self, obj):
847 return "%s" % obj.id
848 _id.short_description = '#'
849 _id.admin_order_field = 'id'
8f3ca727 850
c5964dc2 851 def _service(self, obj):
1b130b25
JPC
852 if obj.service.supprime:
853 return """<span style="color:red">%s</span>""" % obj.service
854 else:
855 return obj.service
6c2b1160 856 _service.short_description = 'Service'
1b130b25 857 _service.allow_tags = True
53ae644d 858
1ce2ddb9
JPC
859 def _responsable(self, obj):
860 try:
22343fe7
OL
861 responsable = u"""<a href="%s"
862 onclick="return showAddAnotherPopup(this)">
863 <img src="%simg/loupe.png"
864 title="Aperçu du poste" />
865 </a>
866 <a href="%s">%s</a>
867 <br />""" % \
868 (reverse('poste_apercu', args=(obj.responsable.id,)),
869 settings.STATIC_URL,
870 reverse('admin:rh_poste_change', args=(obj.responsable.id,)),
871 obj.responsable.nom)
1ce2ddb9
JPC
872 except:
873 responsable = ''
874
875 try:
fc4bf968 876 employe = obj.responsable.rh_dossiers.all()[0]
1ce2ddb9 877 employe_id = obj.responsable.rh_dossiers.all()[0].id
fc4bf968 878 employe_html = u"""<br />
22343fe7
OL
879 <a href="%s"
880 onclick="return showAddAnotherPopup(this)">
881 <img src="%simg/loupe.png"
882 title="Aperçu de l'employé">
883 </a>
884 <a href="%s">%s</a>""" % \
885 (reverse('employe_apercu', args=(employe_id,)),
886 settings.STATIC_URL,
887 reverse('admin:rh_employe_change', args=(employe_id,)),
888 employe)
1ce2ddb9 889 except:
fc4bf968 890 employe_html = ""
1ce2ddb9 891
fc4bf968 892 return "%s %s" % (responsable, employe_html)
1ce2ddb9
JPC
893 _responsable.short_description = 'Responsable'
894 _responsable.allow_tags = True
895
53ae644d 896 def _nom(self, poste):
e49ac947
JPC
897 return """<a href="%s">%s</a>""" % \
898 (reverse('admin:rh_poste_change', args=(poste.id,)),
22343fe7 899 poste.nom)
53ae644d
OL
900 _nom.allow_tags = True
901 _nom.short_description = u'Nom'
902 _nom.admin_order_field = 'nom'
903
33232787
JPC
904 def _date_modification(self, obj):
905 return date(obj.date_modification)
906 _date_modification.short_description = u'date modification'
907 _date_modification.admin_order_field = 'date_modification'
908
53ae644d
OL
909 def _occupe_par(self, obj):
910 """Formatte la méthode Poste.occupe_par() pour l'admin"""
15c5f55a 911 output = u"Vacant"
ae5d7df3 912 if obj.date_fin is not None and obj.date_fin < datetime.date.today():
954ead19 913 return u"s/o"
53ae644d
OL
914 employes = obj.occupe_par()
915 if employes:
916 l = []
917 for e in employes:
22343fe7
OL
918 link = u"""<a href='%s'
919 title='Aperçu de l\'employer'
920 onclick='return showAddAnotherPopup(this)'>
921 <img src='%simg/loupe.png' />
922 </a>
923 <a href='%s'>%s</a>""" % \
b10920ea 924 (reverse('employe_apercu', args=(e.id,)),
822a2c33 925 settings.STATIC_URL,
b10920ea 926 reverse('admin:rh_employe_change', args=(e.id,)),
22343fe7 927 e)
53ae644d
OL
928 l.append(link)
929 output = "\n<br />".join(l)
930 return output
931 _occupe_par.allow_tags = True
22343fe7 932 _occupe_par.short_description = "Occupé par"
53ae644d
OL
933
934 def save_formset(self, request, form, formset, change):
935 instances = formset.save(commit=False)
936 for instance in instances:
937 if instance.__class__ == rh.PosteCommentaire:
938 instance.owner = request.user
02e69aa2 939 instance.date_creation = datetime.datetime.now()
53ae644d
OL
940 instance.save()
941 formset.save_m2m()
942
943
944class PosteCommentaireAdmin(admin.ModelAdmin):
945 pass
946
947
948class PosteFinancementAdmin(admin.ModelAdmin):
949 pass
950
951
952class PostePieceAdmin(admin.ModelAdmin):
953 fk_name = 'poste'
954
955
956class RemunerationAdmin(admin.ModelAdmin):
957 pass
958
959
8c8ffc4f
OL
960class ResponsableInline(admin.TabularInline):
961 model = rh.ResponsableImplantation
962 extra = 0
fc4bf968
EMS
963 fk_name = "implantation"
964
22343fe7 965
8c8ffc4f
OL
966class ResponsableImplantationAdmin(admin.ModelAdmin):
967 actions = None
968 list_filter = ('region', 'statut', )
969 list_display = ('nom', 'statut', '_responsable', )
970 readonly_fields = ('nom', )
971 fields = ('nom', )
972 inlines = (ResponsableInline, )
973
974 def _responsable(self, obj):
975 try:
976 employe = obj.responsable.employe
977 dossiers = employe.dossiers_encours()
978 if len(dossiers) == 0:
979 return u"<span style='color: red;'>%s %s </span>" % (
980 employe, u"sans dossier actif")
981 else:
982 return employe
fc4bf968
EMS
983 except Exception:
984 if obj.statut in (1, 2): # ouverte, ouverture imminente
8c8ffc4f
OL
985 css = "style='color: red;'"
986 else:
987 css = ""
988 return u"<span %s>Pas de responsable</span>" % css
989 _responsable.allow_tags = True
990 _responsable.short_description = u"Responsable"
991
992 def has_add_permission(self, request=None):
993 return False
994
995 def has_change_permission(self, request, obj=None):
996 return in_drh_or_admin(request.user)
997
998 def has_delete_permission(self, request, obj=None):
999 return False
53ae644d 1000
fc4bf968 1001
7ba822a6 1002class ServiceAdmin(AUFMetadataAdminMixin, admin.ModelAdmin, ArchiveMixin):
22343fe7
OL
1003 list_display = (
1004 'nom',
1005 '_archive',
1006 '_date_modification',
1007 'user_modification',
1008 )
cbb0373e 1009 list_filter = ('archive', )
22343fe7 1010 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1011 (None, {
cbb0373e 1012 'fields': ('nom', 'archive', ),
53ae644d
OL
1013 }),
1014 )
1015
33232787 1016 def _date_modification(self, obj):
22343fe7
OL
1017 return date(obj.date_modification) \
1018 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1019 _date_modification.short_description = u'date modification'
1020 _date_modification.admin_order_field = 'date_modification'
1021
fc4bf968 1022
5c0f1778 1023class ServiceProxyAdmin(ServiceAdmin):
cfd5ac68 1024 list_display = ('nom', '_organigramme', '_archive', )
8135fc65
JPC
1025 actions = None
1026
1027 def __init__(self, *args, **kwargs):
1028 super(ServiceProxyAdmin, self).__init__(*args, **kwargs)
1029 self.list_display_links = (None, )
5c0f1778
JPC
1030
1031 def has_add_permission(self, obj):
1032 return False
1033
aa2c508e
JPC
1034 def has_change_permission(self, request, obj=None):
1035 return in_drh_or_admin(request.user)
1036
5c0f1778 1037 def _organigramme(self, obj):
8135fc65
JPC
1038 return """<a href="%s"><strong>Organigramme</strong></a>""" % \
1039 (reverse('rho_service', args=(obj.id,)))
5c0f1778
JPC
1040 _organigramme.allow_tags = True
1041 _organigramme.short_description = "Organigramme"
1042
8135fc65 1043
53ae644d 1044class StatutAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1045 list_display = ('code', 'nom', '_date_modification', 'user_modification', )
22343fe7 1046 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1047 (None, {
1048 'fields': ('code', 'nom', ),
1049 }),
1050 )
1051
33232787 1052 def _date_modification(self, obj):
22343fe7
OL
1053 return date(obj.date_modification) \
1054 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1055 _date_modification.short_description = u'date modification'
1056 _date_modification.admin_order_field = 'date_modification'
1057
22343fe7 1058
53ae644d 1059class TauxChangeAdmin(admin.ModelAdmin):
22343fe7
OL
1060 list_display = (
1061 'taux',
1062 'devise',
1063 'annee',
1064 '_date_modification',
1065 'user_modification',
1066 )
53ae644d 1067 list_filter = ('devise', )
22343fe7 1068 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1069 (None, {
1070 'fields': ('taux', 'devise', 'annee', ),
1071 }),
1072 )
1073
33232787 1074 def _date_modification(self, obj):
22343fe7
OL
1075 return date(obj.date_modification) \
1076 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1077 _date_modification.short_description = u'date modification'
1078 _date_modification.admin_order_field = 'date_modification'
1079
22343fe7 1080
53ae644d 1081class TypeContratAdmin(admin.ModelAdmin):
22343fe7
OL
1082 list_display = (
1083 'nom',
1084 'nom_long',
1085 '_date_modification',
1086 'user_modification',
1087 )
1088 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1089 (None, {
1090 'fields': ('nom', 'nom_long', ),
1091 }),
1092 )
1093
33232787 1094 def _date_modification(self, obj):
22343fe7
OL
1095 return date(obj.date_modification) \
1096 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1097 _date_modification.short_description = u'date modification'
1098 _date_modification.admin_order_field = 'date_modification'
1099
53ae644d
OL
1100
1101class TypePosteAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
1102 search_fields = ('nom', 'nom_feminin', )
22343fe7
OL
1103 list_display = (
1104 'nom',
7bf28694 1105 'categorie_emploi',
22343fe7
OL
1106 '_date_modification',
1107 'user_modification',
1108 )
321fe481 1109 list_filter = ('categorie_emploi', 'famille_professionnelle')
22343fe7 1110 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1111 (None, {
22343fe7
OL
1112 'fields': (
1113 'nom',
1114 'nom_feminin',
1115 'is_responsable',
7bf28694 1116 'categorie_emploi',
321fe481 1117 'famille_professionnelle',
22343fe7
OL
1118 )}
1119 ),
53ae644d
OL
1120 )
1121
33232787 1122 def _date_modification(self, obj):
22343fe7
OL
1123 return date(obj.date_modification) \
1124 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1125 _date_modification.short_description = u'date modification'
1126 _date_modification.admin_order_field = 'date_modification'
1127
53ae644d 1128
fc4bf968
EMS
1129class TypeRemunerationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin,
1130 ArchiveMixin):
22343fe7
OL
1131 list_display = (
1132 'nom',
1133 'type_paiement',
1134 'nature_remuneration',
7ba822a6 1135 '_archive',
22343fe7
OL
1136 '_date_modification',
1137 'user_modification',)
7ba822a6 1138 list_filter = ('archive', )
22343fe7 1139 fieldsets = AUFMetadataAdminMixin.fieldsets + (
7ba822a6
OL
1140 (None, {'fields': ('nom', 'type_paiement', 'nature_remuneration',
1141 'archive')}),
53ae644d
OL
1142 )
1143
33232787 1144 def _date_modification(self, obj):
22343fe7
OL
1145 return date(obj.date_modification) \
1146 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1147 _date_modification.short_description = u'date modification'
1148 _date_modification.admin_order_field = 'date_modification'
1149
53ae644d
OL
1150
1151class TypeRevalorisationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1152 list_display = ('nom', '_date_modification', 'user_modification', )
22343fe7
OL
1153 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1154 (None, {'fields': ('nom', )}),
53ae644d
OL
1155 )
1156
33232787 1157 def _date_modification(self, obj):
22343fe7
OL
1158 return date(obj.date_modification) \
1159 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1160 _date_modification.short_description = u'date modification'
1161 _date_modification.admin_order_field = 'date_modification'
1162
53ae644d
OL
1163
1164class ValeurPointAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
22343fe7
OL
1165 list_display = (
1166 '_devise_code',
1167 '_devise_nom',
1168 'annee',
88202dc3 1169 'implantation',
22343fe7
OL
1170 'valeur',
1171 '_date_modification',
1172 'user_modification',
1173 )
88202dc3 1174 list_filter = ('annee', 'devise', 'implantation__region', )
22343fe7
OL
1175 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1176 (None, {'fields': ('valeur', 'devise', 'implantation', 'annee', )}),
53ae644d
OL
1177 )
1178
33232787 1179 def _date_modification(self, obj):
22343fe7
OL
1180 return date(obj.date_modification) \
1181 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1182 _date_modification.short_description = u'date modification'
1183 _date_modification.admin_order_field = 'date_modification'
1184
53ae644d
OL
1185 def _devise_code(self, obj):
1186 return obj.devise.code
1187 _devise_code.short_description = "Code de la devise"
1188
1189 def _devise_nom(self, obj):
1190 return obj.devise.nom
1191 _devise_nom.short_description = "Nom de la devise"
1192
fc4bf968 1193
82af5c19
JPC
1194class ImplantationProxyAdmin(admin.ModelAdmin):
1195 list_display = ('nom', '_organigramme')
8135fc65
JPC
1196 actions = None
1197
1198 def __init__(self, *args, **kwargs):
1199 super(ImplantationProxyAdmin, self).__init__(*args, **kwargs)
1200 self.list_display_links = (None, )
82af5c19
JPC
1201
1202 def has_add_permission(self, obj):
1203 return False
1204
aa2c508e
JPC
1205 def has_change_permission(self, request, obj=None):
1206 return in_drh_or_admin(request.user)
1207
82af5c19 1208 def _organigramme(self, obj):
fc4bf968
EMS
1209 return '<a href="%s"><strong>Organigramme</strong></a>' % (
1210 reverse('rho_implantation', args=(obj.id,))
1211 )
82af5c19
JPC
1212 _organigramme.allow_tags = True
1213 _organigramme.short_description = "Organigramme"
1214
fc4bf968 1215
9da4c195
JPC
1216class RegionProxyAdmin(admin.ModelAdmin):
1217 list_display = ('nom', '_organigramme')
8135fc65
JPC
1218 actions = None
1219
1220 def __init__(self, *args, **kwargs):
1221 super(RegionProxyAdmin, self).__init__(*args, **kwargs)
1222 self.list_display_links = (None, )
9da4c195
JPC
1223
1224 def has_add_permission(self, obj):
1225 return False
1226
aa2c508e
JPC
1227 def has_change_permission(self, request, obj=None):
1228 return in_drh_or_admin(request.user)
1229
9da4c195 1230 def _organigramme(self, obj):
fc4bf968
EMS
1231 return """<a href="%s"><strong>Organigramme</strong></a>""" % (
1232 reverse('rho_region', args=(obj.id,))
1233 )
9da4c195
JPC
1234 _organigramme.allow_tags = True
1235 _organigramme.short_description = "Organigramme"
1236
1237
53ae644d
OL
1238admin.site.register(rh.Classement, ClassementAdmin)
1239admin.site.register(rh.Devise, DeviseAdmin)
1240admin.site.register(rh.Dossier, DossierAdmin)
22343fe7 1241admin.site.register(EmployeProxy, EmployeProxyAdmin)
5c0f1778 1242admin.site.register(ServiceProxy, ServiceProxyAdmin)
53ae644d 1243admin.site.register(rh.Employe, EmployeAdmin)
7bf28694 1244admin.site.register(rh.CategorieEmploi, CategorieEmploiAdmin)
321fe481 1245admin.site.register(rh.FamilleProfessionnelle)
53ae644d
OL
1246admin.site.register(rh.OrganismeBstg, OrganismeBstgAdmin)
1247admin.site.register(rh.Poste, PosteAdmin)
fc4bf968
EMS
1248admin.site.register(
1249 rh.ResponsableImplantationProxy, ResponsableImplantationAdmin
1250)
53ae644d 1251admin.site.register(rh.Service, ServiceAdmin)
c5964dc2 1252admin.site.register(rh.Statut, StatutAdmin)
53ae644d 1253admin.site.register(rh.TauxChange, TauxChangeAdmin)
c5964dc2 1254admin.site.register(rh.TypeContrat, TypeContratAdmin)
53ae644d
OL
1255admin.site.register(rh.TypePoste, TypePosteAdmin)
1256admin.site.register(rh.TypeRemuneration, TypeRemunerationAdmin)
1257admin.site.register(rh.TypeRevalorisation, TypeRevalorisationAdmin)
1258admin.site.register(rh.ValeurPoint, ValeurPointAdmin)
82af5c19 1259admin.site.register(ImplantationProxy, ImplantationProxyAdmin)
9da4c195 1260admin.site.register(RegionProxy, RegionProxyAdmin)