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