test unitaires droits
[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
d7bf0cd3 21from project.rh import groups
a12ddd52 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:
d7bf0cd3 46 managed = False
9da4c195
JPC
47 proxy = True
48 verbose_name = u"Organigramme par région"
49 verbose_name_plural = u"Organigramme par région"
50
51
82af5c19
JPC
52class ImplantationProxy(ref.Implantation):
53 """ Proxy utilisé pour les organigrammes par implantation """
54 class Meta:
d7bf0cd3 55 managed = False
82af5c19
JPC
56 proxy = True
57 verbose_name = u"Organigramme par implantations"
58 verbose_name_plural = u"Organigramme par implantations"
59
22343fe7 60
5c0f1778
JPC
61class ServiceProxy(rh.Service):
62 """ Proxy utilisé pour les organigrammes opar service """
63 class Meta:
d7bf0cd3 64 managed = False
5c0f1778
JPC
65 proxy = True
66 verbose_name = u"Organigramme par services"
67 verbose_name_plural = u"Organigramme par services"
68
22343fe7 69
5c0f1778
JPC
70class EmployeProxy(rh.Employe):
71 """ Proxy utilisé pour les organigrammes des employés """
22343fe7 72 class Meta:
d7bf0cd3 73 managed = False
22343fe7
OL
74 proxy = True
75 verbose_name = u"Organigramme des employés"
76 verbose_name_plural = u"Organigramme des employés"
77
f614ca5c 78
40b35603 79class DateRangeMixin(object):
a17e2236 80 prefixe_recherche_temporelle = ""
22343fe7 81
40b35603 82 def get_changelist(self, request, **kwargs):
22343fe7 83 if 'HTTP_REFERER' in request.META.keys():
910e39e5
OL
84 referer = request.META['HTTP_REFERER']
85 referer = "/".join(referer.split('/')[3:])
86 referer = "/%s" % referer.split('?')[0]
22343fe7
OL
87 change_list_view = 'admin:%s_%s_changelist' % (
88 self.model._meta.app_label,
89 self.model.__name__.lower(),)
910e39e5
OL
90 if referer != reverse(change_list_view):
91 params = request.GET.copy()
22343fe7 92 params.update({'statut': 'Actif'})
910e39e5 93 request.GET = params
40b35603 94 return ChangeList
3195667e 95
22343fe7 96
53ae644d
OL
97# Override of the InlineModelAdmin to support the link in the tabular inline
98class LinkedInline(admin.options.InlineModelAdmin):
99 template = "admin/linked.html"
100 admin_model_path = None
101
102 def __init__(self, *args):
103 super(LinkedInline, self).__init__(*args)
104 if self.admin_model_path is None:
105 self.admin_model_path = self.model.__name__.lower()
106
107
108class ProtectRegionMixin(object):
109
110 def queryset(self, request):
53ae644d
OL
111 qs = super(ProtectRegionMixin, self).queryset(request)
112
53ae644d 113 user_groups = request.user.groups.all()
a12ddd52 114 if in_drh_or_admin(request.user):
53ae644d
OL
115 return qs
116
d7bf0cd3 117 if groups.grp_correspondants_rh in user_groups:
53ae644d 118 employe = get_employe_from_user(request.user)
22343fe7
OL
119 q = Q(**{self.model.prefix_implantation: \
120 employe.implantation.region})
53ae644d
OL
121 qs = qs.filter(q).distinct()
122 return qs
123 return qs.none()
124
c0be8705
OL
125 def has_add_permission(self, request):
126 if not in_drh_or_admin(request.user):
127 return False
128 else:
129 return True
130
53ae644d 131 def has_change_permission(self, request, obj=None):
20b4867c 132 user_groups = request.user.groups.all()
a0d365ed 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
d7bf0cd3
OL
533 def has_add_permission(self, request):
534 user_groups = request.user.groups.all()
535 if groups.grp_correspondants_rh in user_groups or \
536 groups.grp_administrateurs in user_groups or \
537 groups.grp_directeurs_bureau in user_groups or \
538 in_drh_or_admin(request.user):
539 return True
540 return False
541
b10920ea 542 def _apercu(self, obj):
22343fe7
OL
543 return u"""<a title="Aperçu de l'employé"
544 onclick="return showAddAnotherPopup(this);"
545 href='%s'>
546 <img src="%simg/loupe.png" />
547 </a>""" % \
548 (reverse('employe_apercu', args=(obj.id,)), settings.STATIC_URL)
b10920ea
JPC
549 _apercu.allow_tags = True
550 _apercu.short_description = u""
b10920ea 551
53ae644d 552 def _nom(self, obj):
53ae644d 553 edit_link = reverse('admin:rh_employe_change', args=(obj.id,))
e6c107de 554 return u"""<a href='%s'><strong>%s</strong></a>""" % \
e49ac947 555 (edit_link, "%s %s" % (obj.nom.upper(), obj.prenom))
53ae644d 556 _nom.allow_tags = True
e49ac947 557 _nom.short_description = u"Employé"
53ae644d
OL
558 _nom.admin_order_field = "nom"
559
e49ac947
JPC
560 def _id(self, obj):
561 return obj.id
562 _id.short_description = u"#"
563 _id.admin_order_field = "id"
564
33232787 565 def _date_modification(self, obj):
22343fe7
OL
566 return date(obj.date_modification) \
567 if obj.date_modification is not None else "(aucune)"
33232787
JPC
568 _date_modification.short_description = u'date modification'
569 _date_modification.admin_order_field = 'date_modification'
570
a7f013f5 571 def _dossiers_postes(self, obj):
53ae644d
OL
572 l = []
573 for d in obj.rh_dossiers.all().order_by('-date_debut'):
22343fe7
OL
574 dossier = u"""<a title="Aperçu du dossier"
575 href="%s"
576 onclick="return showAddAnotherPopup(this);"
577 title="Aperçu du dossier">
578 <img src="%simg/loupe.png" />
579 </a>
580 <a href="%s">Dossier</a>
581 &nbsp;""" % \
582 (reverse('dossier_apercu', args=(d.id,)),
583 settings.STATIC_URL,
584 reverse('admin:rh_dossier_change', args=(d.id,)))
585
586 poste = u"""<a title="Aperçu du poste"
587 href="%s"
588 onclick="return showAddAnotherPopup(this);"
589 title="Aperçu du poste">
590 <img src="%simg/loupe.png" />
591 </a>
592 <a href="%s">Poste</a>
593 &nbsp;""" % \
594 (reverse('poste_apercu', args=(d.poste.id,)),
595 settings.STATIC_URL,
596 reverse('admin:rh_poste_change', args=(d.poste.id,)))
a7f013f5
JPC
597 link = u"""<li>%s %s - %s : [%s] %s</li>""" % \
598 (dossier, poste,
53ae644d 599 d.date_debut.year,
a7f013f5
JPC
600 d.poste.id,
601 d.poste.nom,
53ae644d 602 )
b5cc0357
OL
603
604 # Dossier terminé en gris non cliquable
a4329fae 605 if d.date_fin is not None and d.date_fin < datetime.date.today():
a7f013f5 606 link = u"""<li style="color: grey">%s : [%s] %s</li>""" % \
b5cc0357 607 (d.date_debut.year,
a7f013f5
JPC
608 d.poste.id,
609 d.poste.nom,
b5cc0357
OL
610 )
611
53ae644d
OL
612 l.append(link)
613 return "<ul>%s</ul>" % "\n".join(l)
a7f013f5
JPC
614 _dossiers_postes.allow_tags = True
615 _dossiers_postes.short_description = u"Dossiers et postes"
53ae644d
OL
616
617 def queryset(self, request):
22343fe7 618 qs = super(EmployeAdmin, self).queryset(request)
53ae644d
OL
619 return qs.select_related(depth=1).order_by('nom')
620
621 def save_formset(self, request, form, formset, change):
622 instances = formset.save(commit=False)
623 for instance in instances:
624 if instance.__class__ == rh.EmployeCommentaire:
625 instance.owner = request.user
02e69aa2 626 instance.date_creation = datetime.datetime.now()
53ae644d
OL
627 instance.save()
628
22343fe7 629
08faf06e 630class EmployeProxyAdmin(EmployeAdmin):
22343fe7 631 list_display = ('_id', '_apercu', '_nom', '_organigramme')
bd917a45
JPC
632 actions = None
633
634 def __init__(self, *args, **kwargs):
635 super(EmployeProxyAdmin, self).__init__(*args, **kwargs)
636 self.list_display_links = (None, )
08faf06e 637
22343fe7
OL
638 def has_add_permission(self, obj):
639 return False
640
08faf06e
JPC
641 def _organigramme(self, obj):
642 l = []
fc4bf968
EMS
643 for d in rh.Dossier.objects.filter(
644 Q(date_fin__gt=datetime.date.today()) | Q(date_fin=None),
645 Q(date_debut__lt=datetime.date.today()) | Q(date_debut=None),
646 employe=obj.id
647 ):
648 organigramme = \
649 u'Organigramme, niveau: ' \
650 u'<input type="text" id="level_%s" ' \
651 u'style="width:30px;height:15px;" /> ' \
652 u'<input type="button" value="Générer" ' \
653 u"""onclick="window.location='%s' + """ \
654 u"""document.getElementById('level_%s').value" />""" % (
655 d.poste.id,
656 reverse('rho_employe_sans_niveau', args=(d.poste.id,)),
657 d.poste.id
658 )
659 link = u"""<li>%s - [%s] %s : %s</li>""" % (
660 d.date_debut.year,
661 d.poste.id,
662 d.poste.nom,
663 organigramme
664 )
08faf06e
JPC
665 l.append(link)
666 return "<ul>%s</ul>" % "\n".join(l)
667
668 _organigramme.allow_tags = True
669 _organigramme.short_description = "Organigramme"
670
53ae644d 671
53ae644d
OL
672class EmployeCommentaireAdmin(admin.ModelAdmin):
673 pass
674
675
676class EmployePieceAdmin(admin.ModelAdmin):
677 pass
678
679
7bf28694 680class CategorieEmploiAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 681 list_display = ('nom', '_date_modification', 'user_modification', )
53ae644d 682 inlines = (TypePosteInline,)
22343fe7
OL
683 fieldsets = AUFMetadataAdminMixin.fieldsets + (
684 (None, {'fields': ('nom', )}),)
53ae644d 685
33232787 686 def _date_modification(self, obj):
22343fe7
OL
687 return date(obj.date_modification) \
688 if obj.date_modification is not None else "(aucune)"
33232787
JPC
689 _date_modification.short_description = u'date modification'
690 _date_modification.admin_order_field = 'date_modification'
53ae644d 691
22343fe7 692
95b630cf 693class OrganismeBstgAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 694 search_fields = ('nom',)
22343fe7
OL
695 list_display = (
696 'nom',
697 'type',
698 'pays',
699 '_date_modification',
700 'user_modification',
701 )
c5964dc2 702 list_filter = ('type', )
53ae644d 703 inlines = (DossierROInline,)
22343fe7
OL
704 fieldsets = AUFMetadataAdminMixin.fieldsets + (
705 (None, {'fields': ('nom', 'type', 'pays',)}),
53ae644d
OL
706 )
707
33232787 708 def _date_modification(self, obj):
22343fe7
OL
709 return date(obj.date_modification) \
710 if obj.date_modification is not None else "(aucune)"
33232787
JPC
711 _date_modification.short_description = u'date modification'
712 _date_modification.admin_order_field = 'date_modification'
713
53ae644d 714
22343fe7
OL
715class PosteAdmin(DateRangeMixin, AUFMetadataAdminMixin, \
716 ProtectRegionMixin, admin.ModelAdmin, AjaxSelect,):
717 form = make_ajax_form(rh.Poste, {
718 'implantation': 'implantations',
719 'type_poste': 'typepostes',
720 'responsable': 'postes',
721 'valeur_point_min': 'valeurpoints',
722 'valeur_point_max': 'valeurpoints',
53ae644d
OL
723 })
724 alphabet_filter = 'nom'
22343fe7 725 search_fields = (
397bf8dd 726 'id',
22343fe7 727 'nom',
22343fe7
OL
728 'implantation__nom',
729 'implantation__region__code',
730 'implantation__region__nom',
731 'rh_dossiers__employe__nom',
732 'rh_dossiers__employe__prenom',
733 )
53ae644d 734 list_display = (
e49ac947 735 '_id',
8f3ca727 736 '_apercu',
22343fe7 737 '_nom',
53ae644d 738 '_occupe_par',
22343fe7
OL
739 'implantation',
740 '_service',
1ce2ddb9 741 '_responsable',
352fa696 742 'date_debut',
53ae644d 743 'date_fin',
33232787 744 '_date_modification',
53ae644d 745 'user_modification',
a47ed016 746 '_dae',
53ae644d 747 )
f614ca5c 748 list_filter = (
22343fe7 749 'implantation__region',
53ae644d 750 'implantation',
22343fe7 751 'service',
53ae644d 752 'type_poste',
7bf28694 753 'type_poste__categorie_emploi',
118efe7a 754 'type_poste__famille_professionnelle',
4c53dda4 755 'vacant',
53ae644d 756 )
e49ac947 757 list_display_links = ('_nom',)
53ae644d 758 fieldsets = AUFMetadataAdminMixin.fieldsets + (
22343fe7
OL
759 (None, {'fields': (
760 ('nom', 'nom_feminin'),
761 'implantation',
762 'type_poste',
763 'service',
764 'responsable',
765 )}
766 ),
53ae644d 767 ('Contrat', {
22343fe7
OL
768 'fields': ((
769 'regime_travail',
770 'regime_travail_nb_heure_semaine'),
771 )}
772 ),
53ae644d 773 ('Recrutement', {
22343fe7
OL
774 'fields': (('local', 'expatrie', 'mise_a_disposition', 'appel'),)}
775 ),
53ae644d 776 ('Rémunération', {
22343fe7
OL
777 'fields': (('classement_min',
778 'valeur_point_min',
779 'devise_min',
780 'salaire_min',
781 'indemn_min',
782 'autre_min',),
783 ('classement_max',
784 'valeur_point_max',
785 'devise_max',
786 'salaire_max',
787 'indemn_max',
788 'autre_max',),
789 )}),
53ae644d
OL
790 ('Comparatifs de rémunération', {
791 'fields': ('devise_comparaison',
792 ('comp_locale_min', 'comp_locale_max'),
793 ('comp_universite_min', 'comp_universite_max'),
794 ('comp_fonctionpub_min', 'comp_fonctionpub_max'),
795 ('comp_ong_min', 'comp_ong_max'),
22343fe7
OL
796 ('comp_autre_min', 'comp_autre_max'))}
797 ),
53ae644d 798 ('Justification', {
22343fe7
OL
799 'fields': ('justification',)}
800 ),
48a6df80 801 ('Autres Méta-données', {
22343fe7
OL
802 'fields': ('date_debut', 'date_fin')}
803 ),
53ae644d
OL
804 )
805
806 inlines = (PosteFinancementInline,
807 PostePieceInline,
808 DossierROInline,
6f037929 809 PosteComparaisonInline,
53ae644d
OL
810 PosteCommentaireInline, )
811
f614ca5c 812 def lookup_allowed(self, key, value):
118efe7a
EMS
813 return key in (
814 'date_debut__gte', 'date_debut__isnull', 'date_fin__lte',
815 'date_fin__isnull', 'implantation__region__id__exact',
816 'implantation__id__exact', 'type_poste__id__exact',
817 'type_poste__categorie_emploi__id__exact', 'service__id__exact',
818 'service__isnull', 'vacant__exact', 'vacant__isnull',
819 ) or super(PosteAdmin, self).lookup_allowed(key, value)
f614ca5c 820
8f3ca727 821 def _apercu(self, poste):
22343fe7
OL
822 view_link = u"""<a onclick="return showAddAnotherPopup(this);"
823 title="Aperçu du poste"
824 href='%s'>
825 <img src="%simg/loupe.png" />
826 </a>""" % \
8f3ca727 827 (reverse('poste_apercu', args=(poste.id,)),
22343fe7
OL
828 settings.STATIC_URL,)
829 return view_link
8f3ca727 830 _apercu.allow_tags = True
e49ac947
JPC
831 _apercu.short_description = ''
832
a47ed016
OL
833 def _dae(self, poste):
834 apercu_link = ""
de151a1e
EMS
835 postes_dae = poste.postes_dae.all()
836 if len(postes_dae) > 0:
837 poste_dae = postes_dae[0]
838 apercu_link = \
839 u'<a title="Aperçu du dossier" href="%s" ' \
840 u'onclick="return showAddAnotherPopup(this);">' \
841 u'<img src="%simg/loupe.png" /></a>' % (reverse(
842 'poste_consulter', args=("dae-%s" % poste_dae.id,)
843 ), settings.STATIC_URL)
a47ed016
OL
844 return apercu_link
845 _dae.allow_tags = True
846 _dae.short_description = u"DAE"
847
e49ac947
JPC
848 def _id(self, obj):
849 return "%s" % obj.id
850 _id.short_description = '#'
851 _id.admin_order_field = 'id'
8f3ca727 852
c5964dc2 853 def _service(self, obj):
1b130b25
JPC
854 if obj.service.supprime:
855 return """<span style="color:red">%s</span>""" % obj.service
856 else:
857 return obj.service
6c2b1160 858 _service.short_description = 'Service'
1b130b25 859 _service.allow_tags = True
53ae644d 860
1ce2ddb9
JPC
861 def _responsable(self, obj):
862 try:
22343fe7
OL
863 responsable = u"""<a href="%s"
864 onclick="return showAddAnotherPopup(this)">
865 <img src="%simg/loupe.png"
866 title="Aperçu du poste" />
867 </a>
868 <a href="%s">%s</a>
869 <br />""" % \
870 (reverse('poste_apercu', args=(obj.responsable.id,)),
871 settings.STATIC_URL,
872 reverse('admin:rh_poste_change', args=(obj.responsable.id,)),
873 obj.responsable.nom)
1ce2ddb9
JPC
874 except:
875 responsable = ''
876
877 try:
fc4bf968 878 employe = obj.responsable.rh_dossiers.all()[0]
1ce2ddb9 879 employe_id = obj.responsable.rh_dossiers.all()[0].id
fc4bf968 880 employe_html = u"""<br />
22343fe7
OL
881 <a href="%s"
882 onclick="return showAddAnotherPopup(this)">
883 <img src="%simg/loupe.png"
884 title="Aperçu de l'employé">
885 </a>
886 <a href="%s">%s</a>""" % \
887 (reverse('employe_apercu', args=(employe_id,)),
888 settings.STATIC_URL,
889 reverse('admin:rh_employe_change', args=(employe_id,)),
890 employe)
1ce2ddb9 891 except:
fc4bf968 892 employe_html = ""
1ce2ddb9 893
fc4bf968 894 return "%s %s" % (responsable, employe_html)
1ce2ddb9
JPC
895 _responsable.short_description = 'Responsable'
896 _responsable.allow_tags = True
897
53ae644d 898 def _nom(self, poste):
e49ac947
JPC
899 return """<a href="%s">%s</a>""" % \
900 (reverse('admin:rh_poste_change', args=(poste.id,)),
22343fe7 901 poste.nom)
53ae644d
OL
902 _nom.allow_tags = True
903 _nom.short_description = u'Nom'
904 _nom.admin_order_field = 'nom'
905
33232787
JPC
906 def _date_modification(self, obj):
907 return date(obj.date_modification)
908 _date_modification.short_description = u'date modification'
909 _date_modification.admin_order_field = 'date_modification'
910
53ae644d
OL
911 def _occupe_par(self, obj):
912 """Formatte la méthode Poste.occupe_par() pour l'admin"""
15c5f55a 913 output = u"Vacant"
ae5d7df3 914 if obj.date_fin is not None and obj.date_fin < datetime.date.today():
954ead19 915 return u"s/o"
53ae644d
OL
916 employes = obj.occupe_par()
917 if employes:
918 l = []
919 for e in employes:
22343fe7
OL
920 link = u"""<a href='%s'
921 title='Aperçu de l\'employer'
922 onclick='return showAddAnotherPopup(this)'>
923 <img src='%simg/loupe.png' />
924 </a>
925 <a href='%s'>%s</a>""" % \
b10920ea 926 (reverse('employe_apercu', args=(e.id,)),
822a2c33 927 settings.STATIC_URL,
b10920ea 928 reverse('admin:rh_employe_change', args=(e.id,)),
22343fe7 929 e)
53ae644d
OL
930 l.append(link)
931 output = "\n<br />".join(l)
932 return output
933 _occupe_par.allow_tags = True
22343fe7 934 _occupe_par.short_description = "Occupé par"
53ae644d
OL
935
936 def save_formset(self, request, form, formset, change):
937 instances = formset.save(commit=False)
938 for instance in instances:
939 if instance.__class__ == rh.PosteCommentaire:
940 instance.owner = request.user
02e69aa2 941 instance.date_creation = datetime.datetime.now()
53ae644d
OL
942 instance.save()
943 formset.save_m2m()
944
945
946class PosteCommentaireAdmin(admin.ModelAdmin):
947 pass
948
949
950class PosteFinancementAdmin(admin.ModelAdmin):
951 pass
952
953
954class PostePieceAdmin(admin.ModelAdmin):
955 fk_name = 'poste'
956
957
958class RemunerationAdmin(admin.ModelAdmin):
959 pass
960
961
8c8ffc4f
OL
962class ResponsableInline(admin.TabularInline):
963 model = rh.ResponsableImplantation
964 extra = 0
fc4bf968
EMS
965 fk_name = "implantation"
966
22343fe7 967
8c8ffc4f
OL
968class ResponsableImplantationAdmin(admin.ModelAdmin):
969 actions = None
970 list_filter = ('region', 'statut', )
971 list_display = ('nom', 'statut', '_responsable', )
972 readonly_fields = ('nom', )
973 fields = ('nom', )
974 inlines = (ResponsableInline, )
975
976 def _responsable(self, obj):
977 try:
978 employe = obj.responsable.employe
979 dossiers = employe.dossiers_encours()
980 if len(dossiers) == 0:
981 return u"<span style='color: red;'>%s %s </span>" % (
982 employe, u"sans dossier actif")
983 else:
984 return employe
fc4bf968
EMS
985 except Exception:
986 if obj.statut in (1, 2): # ouverte, ouverture imminente
8c8ffc4f
OL
987 css = "style='color: red;'"
988 else:
989 css = ""
990 return u"<span %s>Pas de responsable</span>" % css
991 _responsable.allow_tags = True
992 _responsable.short_description = u"Responsable"
993
994 def has_add_permission(self, request=None):
995 return False
996
997 def has_change_permission(self, request, obj=None):
998 return in_drh_or_admin(request.user)
999
1000 def has_delete_permission(self, request, obj=None):
1001 return False
53ae644d 1002
fc4bf968 1003
7ba822a6 1004class ServiceAdmin(AUFMetadataAdminMixin, admin.ModelAdmin, ArchiveMixin):
22343fe7
OL
1005 list_display = (
1006 'nom',
1007 '_archive',
1008 '_date_modification',
1009 'user_modification',
1010 )
cbb0373e 1011 list_filter = ('archive', )
22343fe7 1012 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1013 (None, {
cbb0373e 1014 'fields': ('nom', 'archive', ),
53ae644d
OL
1015 }),
1016 )
1017
33232787 1018 def _date_modification(self, obj):
22343fe7
OL
1019 return date(obj.date_modification) \
1020 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1021 _date_modification.short_description = u'date modification'
1022 _date_modification.admin_order_field = 'date_modification'
1023
fc4bf968 1024
5c0f1778 1025class ServiceProxyAdmin(ServiceAdmin):
cfd5ac68 1026 list_display = ('nom', '_organigramme', '_archive', )
8135fc65
JPC
1027 actions = None
1028
1029 def __init__(self, *args, **kwargs):
1030 super(ServiceProxyAdmin, self).__init__(*args, **kwargs)
1031 self.list_display_links = (None, )
5c0f1778
JPC
1032
1033 def has_add_permission(self, obj):
1034 return False
1035
aa2c508e
JPC
1036 def has_change_permission(self, request, obj=None):
1037 return in_drh_or_admin(request.user)
1038
5c0f1778 1039 def _organigramme(self, obj):
8135fc65
JPC
1040 return """<a href="%s"><strong>Organigramme</strong></a>""" % \
1041 (reverse('rho_service', args=(obj.id,)))
5c0f1778
JPC
1042 _organigramme.allow_tags = True
1043 _organigramme.short_description = "Organigramme"
1044
8135fc65 1045
53ae644d 1046class StatutAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1047 list_display = ('code', 'nom', '_date_modification', 'user_modification', )
22343fe7 1048 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1049 (None, {
1050 'fields': ('code', 'nom', ),
1051 }),
1052 )
1053
33232787 1054 def _date_modification(self, obj):
22343fe7
OL
1055 return date(obj.date_modification) \
1056 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1057 _date_modification.short_description = u'date modification'
1058 _date_modification.admin_order_field = 'date_modification'
1059
22343fe7 1060
53ae644d 1061class TauxChangeAdmin(admin.ModelAdmin):
22343fe7
OL
1062 list_display = (
1063 'taux',
1064 'devise',
1065 'annee',
1066 '_date_modification',
1067 'user_modification',
1068 )
53ae644d 1069 list_filter = ('devise', )
22343fe7 1070 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1071 (None, {
1072 'fields': ('taux', 'devise', 'annee', ),
1073 }),
1074 )
1075
33232787 1076 def _date_modification(self, obj):
22343fe7
OL
1077 return date(obj.date_modification) \
1078 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1079 _date_modification.short_description = u'date modification'
1080 _date_modification.admin_order_field = 'date_modification'
1081
22343fe7 1082
53ae644d 1083class TypeContratAdmin(admin.ModelAdmin):
22343fe7
OL
1084 list_display = (
1085 'nom',
1086 'nom_long',
1087 '_date_modification',
1088 'user_modification',
1089 )
1090 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d
OL
1091 (None, {
1092 'fields': ('nom', 'nom_long', ),
1093 }),
1094 )
1095
33232787 1096 def _date_modification(self, obj):
22343fe7
OL
1097 return date(obj.date_modification) \
1098 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1099 _date_modification.short_description = u'date modification'
1100 _date_modification.admin_order_field = 'date_modification'
1101
53ae644d
OL
1102
1103class TypePosteAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
1104 search_fields = ('nom', 'nom_feminin', )
22343fe7
OL
1105 list_display = (
1106 'nom',
7bf28694 1107 'categorie_emploi',
22343fe7
OL
1108 '_date_modification',
1109 'user_modification',
1110 )
321fe481 1111 list_filter = ('categorie_emploi', 'famille_professionnelle')
22343fe7 1112 fieldsets = AUFMetadataAdminMixin.fieldsets + (
53ae644d 1113 (None, {
22343fe7
OL
1114 'fields': (
1115 'nom',
1116 'nom_feminin',
1117 'is_responsable',
7bf28694 1118 'categorie_emploi',
321fe481 1119 'famille_professionnelle',
22343fe7
OL
1120 )}
1121 ),
53ae644d
OL
1122 )
1123
33232787 1124 def _date_modification(self, obj):
22343fe7
OL
1125 return date(obj.date_modification) \
1126 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1127 _date_modification.short_description = u'date modification'
1128 _date_modification.admin_order_field = 'date_modification'
1129
53ae644d 1130
fc4bf968
EMS
1131class TypeRemunerationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin,
1132 ArchiveMixin):
22343fe7
OL
1133 list_display = (
1134 'nom',
1135 'type_paiement',
1136 'nature_remuneration',
7ba822a6 1137 '_archive',
22343fe7
OL
1138 '_date_modification',
1139 'user_modification',)
7ba822a6 1140 list_filter = ('archive', )
22343fe7 1141 fieldsets = AUFMetadataAdminMixin.fieldsets + (
7ba822a6
OL
1142 (None, {'fields': ('nom', 'type_paiement', 'nature_remuneration',
1143 'archive')}),
53ae644d
OL
1144 )
1145
33232787 1146 def _date_modification(self, obj):
22343fe7
OL
1147 return date(obj.date_modification) \
1148 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1149 _date_modification.short_description = u'date modification'
1150 _date_modification.admin_order_field = 'date_modification'
1151
53ae644d
OL
1152
1153class TypeRevalorisationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
33232787 1154 list_display = ('nom', '_date_modification', 'user_modification', )
22343fe7
OL
1155 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1156 (None, {'fields': ('nom', )}),
53ae644d
OL
1157 )
1158
33232787 1159 def _date_modification(self, obj):
22343fe7
OL
1160 return date(obj.date_modification) \
1161 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1162 _date_modification.short_description = u'date modification'
1163 _date_modification.admin_order_field = 'date_modification'
1164
53ae644d
OL
1165
1166class ValeurPointAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
22343fe7
OL
1167 list_display = (
1168 '_devise_code',
1169 '_devise_nom',
1170 'annee',
88202dc3 1171 'implantation',
22343fe7
OL
1172 'valeur',
1173 '_date_modification',
1174 'user_modification',
1175 )
88202dc3 1176 list_filter = ('annee', 'devise', 'implantation__region', )
22343fe7
OL
1177 fieldsets = AUFMetadataAdminMixin.fieldsets + (
1178 (None, {'fields': ('valeur', 'devise', 'implantation', 'annee', )}),
53ae644d
OL
1179 )
1180
33232787 1181 def _date_modification(self, obj):
22343fe7
OL
1182 return date(obj.date_modification) \
1183 if obj.date_modification is not None else "(aucune)"
33232787
JPC
1184 _date_modification.short_description = u'date modification'
1185 _date_modification.admin_order_field = 'date_modification'
1186
53ae644d
OL
1187 def _devise_code(self, obj):
1188 return obj.devise.code
1189 _devise_code.short_description = "Code de la devise"
1190
1191 def _devise_nom(self, obj):
1192 return obj.devise.nom
1193 _devise_nom.short_description = "Nom de la devise"
1194
fc4bf968 1195
82af5c19
JPC
1196class ImplantationProxyAdmin(admin.ModelAdmin):
1197 list_display = ('nom', '_organigramme')
8135fc65
JPC
1198 actions = None
1199
1200 def __init__(self, *args, **kwargs):
1201 super(ImplantationProxyAdmin, self).__init__(*args, **kwargs)
1202 self.list_display_links = (None, )
82af5c19
JPC
1203
1204 def has_add_permission(self, obj):
1205 return False
1206
aa2c508e
JPC
1207 def has_change_permission(self, request, obj=None):
1208 return in_drh_or_admin(request.user)
1209
82af5c19 1210 def _organigramme(self, obj):
fc4bf968
EMS
1211 return '<a href="%s"><strong>Organigramme</strong></a>' % (
1212 reverse('rho_implantation', args=(obj.id,))
1213 )
82af5c19
JPC
1214 _organigramme.allow_tags = True
1215 _organigramme.short_description = "Organigramme"
1216
fc4bf968 1217
9da4c195
JPC
1218class RegionProxyAdmin(admin.ModelAdmin):
1219 list_display = ('nom', '_organigramme')
8135fc65
JPC
1220 actions = None
1221
1222 def __init__(self, *args, **kwargs):
1223 super(RegionProxyAdmin, self).__init__(*args, **kwargs)
1224 self.list_display_links = (None, )
9da4c195
JPC
1225
1226 def has_add_permission(self, obj):
1227 return False
1228
aa2c508e
JPC
1229 def has_change_permission(self, request, obj=None):
1230 return in_drh_or_admin(request.user)
1231
9da4c195 1232 def _organigramme(self, obj):
fc4bf968
EMS
1233 return """<a href="%s"><strong>Organigramme</strong></a>""" % (
1234 reverse('rho_region', args=(obj.id,))
1235 )
9da4c195
JPC
1236 _organigramme.allow_tags = True
1237 _organigramme.short_description = "Organigramme"
1238
1239
53ae644d
OL
1240admin.site.register(rh.Classement, ClassementAdmin)
1241admin.site.register(rh.Devise, DeviseAdmin)
1242admin.site.register(rh.Dossier, DossierAdmin)
22343fe7 1243admin.site.register(EmployeProxy, EmployeProxyAdmin)
5c0f1778 1244admin.site.register(ServiceProxy, ServiceProxyAdmin)
53ae644d 1245admin.site.register(rh.Employe, EmployeAdmin)
7bf28694 1246admin.site.register(rh.CategorieEmploi, CategorieEmploiAdmin)
321fe481 1247admin.site.register(rh.FamilleProfessionnelle)
53ae644d
OL
1248admin.site.register(rh.OrganismeBstg, OrganismeBstgAdmin)
1249admin.site.register(rh.Poste, PosteAdmin)
fc4bf968
EMS
1250admin.site.register(
1251 rh.ResponsableImplantationProxy, ResponsableImplantationAdmin
1252)
53ae644d 1253admin.site.register(rh.Service, ServiceAdmin)
c5964dc2 1254admin.site.register(rh.Statut, StatutAdmin)
53ae644d 1255admin.site.register(rh.TauxChange, TauxChangeAdmin)
c5964dc2 1256admin.site.register(rh.TypeContrat, TypeContratAdmin)
53ae644d
OL
1257admin.site.register(rh.TypePoste, TypePosteAdmin)
1258admin.site.register(rh.TypeRemuneration, TypeRemunerationAdmin)
1259admin.site.register(rh.TypeRevalorisation, TypeRevalorisationAdmin)
1260admin.site.register(rh.ValeurPoint, ValeurPointAdmin)
82af5c19 1261admin.site.register(ImplantationProxy, ImplantationProxyAdmin)
9da4c195 1262admin.site.register(RegionProxy, RegionProxyAdmin)