vacant filter
[auf_rh_dae.git] / project / rh / admin.py
CommitLineData
53ae644d
OL
1# -*- encoding: utf-8 -*-
2
3from collections import defaultdict
4import datetime
5
6from django.db import models
7from django import forms
8from django.core.urlresolvers import reverse
50fa9bc1 9from django.contrib import admin
53ae644d
OL
10from django.conf import settings
11from django.db.models import Q
12from ajax_select import make_ajax_form
13from auf.django.metadata.admin import AUFMetadataAdminMixin, AUFMetadataInlineAdminMixin, AUF_METADATA_READONLY_FIELDS
14from forms import ContratForm, AyantDroitForm, EmployeAdminForm, AjaxSelect
15from dae.utils import get_employe_from_user
16import models as rh
17
18# Override of the InlineModelAdmin to support the link in the tabular inline
19class LinkedInline(admin.options.InlineModelAdmin):
20 template = "admin/linked.html"
21 admin_model_path = None
22
23 def __init__(self, *args):
24 super(LinkedInline, self).__init__(*args)
25 if self.admin_model_path is None:
26 self.admin_model_path = self.model.__name__.lower()
27
28
29class ProtectRegionMixin(object):
30
31 def queryset(self, request):
32 from dae.workflow import grp_drh, grp_correspondants_rh
33 qs = super(ProtectRegionMixin, self).queryset(request)
34
35 if request.user.is_superuser:
36 return qs
37
38 user_groups = request.user.groups.all()
39
40 if grp_drh in user_groups:
41 return qs
42
43 if grp_correspondants_rh in user_groups:
44 employe = get_employe_from_user(request.user)
45 q = Q(**{self.model.prefix_implantation: employe.implantation.region})
46 qs = qs.filter(q).distinct()
47 return qs
48 return qs.none()
49
50 def has_change_permission(self, request, obj=None):
51 if obj is None:
52 return True
53 ids = [o.id for o in self.queryset(request)]
54 return obj.id in ids
55
56
57# Inlines
58
59class ReadOnlyInlineMixin(object):
60 def get_readonly_fields(self, request, obj=None):
61 return [f.name for f in self.model._meta.fields if f.name not in AUF_METADATA_READONLY_FIELDS]
62
63
64class AyantDroitInline(AUFMetadataInlineAdminMixin, admin.StackedInline):
65 model = rh.AyantDroit
66 form = AyantDroitForm
67 extra = 0
68
69 fieldsets = (
70 (None, {
71 'fields': (('nom', 'prenom'), ('nom_affichage', 'genre'), 'nationalite', 'date_naissance', 'lien_parente', )
72 }),
73 )
74
75
76class AyantDroitCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
77 readonly_fields = ('owner', )
78 model = rh.AyantDroitCommentaire
79 extra = 1
80
81
82class ContratInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
83 form = ContratForm
84 model = rh.Contrat
85 extra = 1
86
87
88class DossierROInline(ReadOnlyInlineMixin, LinkedInline):
89 template = "admin/rh/dossier/linked.html"
90 exclude = AUF_METADATA_READONLY_FIELDS
91 model = rh.Dossier
92 extra = 0
93 can_delete = False
94
95 def has_add_permission(self, request=None):
96 return False
97
98 def has_change_permission(self, request, obj=None):
99 return False
100
101 def has_delete_permission(self, request, obj=None):
102 return False
103
104
105class DossierCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
106 readonly_fields = ('owner', )
107 model = rh.DossierCommentaire
108 extra = 1
109
110
111class DossierPieceInline(admin.TabularInline):
112 model = rh.DossierPiece
113 extra = 4
114
115
116class EmployeInline(admin.TabularInline):
117 model = rh.Employe
118
119class EmployeCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
120 readonly_fields = ('owner', )
121 model = rh.EmployeCommentaire
122 extra = 1
123
124
125class EmployePieceInline(admin.TabularInline):
126 model = rh.EmployePiece
127 extra = 4
128
129
53ae644d
OL
130class PosteCommentaireInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
131 readonly_fields = ('owner', )
132 model = rh.PosteCommentaire
133 extra = 1
134
135
136class PosteFinancementInline(admin.TabularInline):
137 model = rh.PosteFinancement
138
139
140class PostePieceInline(admin.TabularInline):
141 model = rh.PostePiece
142
143
144class RemunerationInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
145 model = rh.Remuneration
146 extra = 1
147
148
149class RemunerationROInline(ReadOnlyInlineMixin, RemunerationInline):
150 pass
151
152
153class TypePosteInline(AUFMetadataInlineAdminMixin, admin.TabularInline):
154 model = rh.TypePoste
155
156
157class AyantDroitAdmin(AUFMetadataAdminMixin, ProtectRegionMixin, admin.ModelAdmin):
158 """
159 L'ajout d'un nouvel ayantdroit se fait dans l'admin de l'employé.
160 """
161 alphabet_filter = 'nom'
162 search_fields = ('nom', 'prenom', 'employe__nom', 'employe__prenom', )
163 list_display = ('_employe', 'lien_parente', '_ayantdroit', )
164 inlines = (AyantDroitCommentaireInline,)
165 readonly_fields = AUFMetadataAdminMixin.readonly_fields + ('employe',)
166 fieldsets = AUFMetadataAdminMixin.fieldsets + (
167 ("Lien avec l'employé", {
168 'fields': (('employe', 'lien_parente'), )
169 }),
170
171 ('Identification', {
172 'fields': (('nom', 'prenom'), ('nom_affichage', 'genre'), 'nationalite', 'date_naissance', )
173 }),
174 )
175
176 def save_formset(self, request, form, formset, change):
177 instances = formset.save(commit=False)
178 for instance in instances:
179 if instance.__class__ == rh.AyantDroitCommentaire:
180 instance.owner = request.user
181 instance.save()
182
183 def _ayantdroit(self, obj):
184 return unicode(obj)
185 _ayantdroit.short_description = u'Ayant droit'
186
187 def _employe(self, obj):
188 return unicode(obj.employe)
189 _employe.short_description = u'Employé'
190
191 def has_add_permission(self, request):
192 return False
193
194class AyantDroitCommentaireAdmin(admin.ModelAdmin):
195 pass
196
197
198class ClassementAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 199 list_display = ('_classement', 'date_modification', 'user_modification', )
53ae644d
OL
200 fieldsets = AUFMetadataAdminMixin.fieldsets + (
201 (None, {
202 'fields': ('type', 'echelon', 'degre', 'coefficient', )
203 }),
204 )
205
c5964dc2
OL
206 def _classement(self, obj):
207 return unicode(obj)
208 _classement.short_description = u"Classement"
53ae644d
OL
209
210class CommentaireAdmin(admin.ModelAdmin):
211 pass
212
213
53ae644d 214class DeviseAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 215 list_display = ('code', 'nom', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
216 fieldsets = AUFMetadataAdminMixin.fieldsets + (
217 (None, {
218 'fields': ('code', 'nom', ),
219 }),
220 )
221
222
223class DossierAdmin(AUFMetadataAdminMixin, ProtectRegionMixin, admin.ModelAdmin, AjaxSelect):
224 alphabet_filter = 'employe__nom'
225 search_fields = ('employe__nom', 'employe__prenom', 'poste__nom', 'poste__nom_feminin')
226 list_display = (
227 '_id',
228 '_poste',
229 '_employe',
230 '_date_debut',
231 '_date_fin',
232 'date_modification',
c5964dc2 233 'user_modification',
53ae644d
OL
234 'actif',
235 )
236 list_filter = (
237 'poste__implantation__region',
238 'poste__implantation',
239 'poste__type_poste',
240 'poste__type_poste__famille_emploi',
241 'rh_contrats__type_contrat',
242 'actif',
243 )
244 inlines = (DossierPieceInline, ContratInline,
245 RemunerationInline,
53ae644d
OL
246 DossierCommentaireInline,
247 )
248 fieldsets = AUFMetadataAdminMixin.fieldsets + (
249 (None, {
250 'fields': ('employe', 'poste', 'statut', 'organisme_bstg',)
251 }),
252 ('Recrutement', {
253 'fields': ('statut_residence', 'remplacement', 'remplacement_de', )
254 }),
255 ('Rémunération', {
256 'fields': ('classement', ('regime_travail', 'regime_travail_nb_heure_semaine'),)
257 }),
258 ('Occupation du Poste par cet Employe', {
259 'fields': (('date_debut', 'date_fin'), )
260 }),
261 )
262 form = make_ajax_form(rh.Dossier, {
263 'employe' : 'employes',
264 'poste' : 'postes',
265 'remplacement_de' : 'dossiers',
266 })
267
268 def lookup_allowed(self, key, value):
269 if key in (
270 'employe__nom__istartswith',
271 'actif__exact',
272 'poste__implantation__region__id__exact',
273 'poste__implantation__id__exact',
274 'poste__type_poste__id__exact',
275 'poste__type_poste__famille_emploi__id__exact',
276 'rh_contrats__type_contrat__id__exact',
277 ):
278 return True
279
280 def _id(self, d):
281 link = u"""<a onclick="return showAddAnotherPopup(this);" href='%s'>%s</a> <a href="%s" title="Modifier le dossier"><img src="%simg/page_edit.png" /></a>""" % \
282 (reverse('dossier_apercu', args=(d.id,)),
283 d.id,
284 reverse('admin:rh_dossier_change', args=(d.id,)),
285 settings.MEDIA_URL,
286 )
287 return link
288 _id.allow_tags = True
289 _id.short_description = u'#'
290 _id.admin_order_field = 'id'
291
292
293 def _actif(self, dossier):
294 if dossier.employe.actif:
295 html = """<img alt="True" src="%simg/admin/icon-yes.gif">"""
296 else:
297 html = """<img alt="False" src="%simg/admin/icon-no.gif">"""
298 return html % settings.ADMIN_MEDIA_PREFIX
299 _actif.allow_tags = True
300 _actif.short_description = u'Employé actif'
301 _actif.admin_order_field = 'employe__actif'
302
303 def _date_debut(self, obj):
304 return obj.date_debut
305 _date_debut.short_description = u'Occupation début'
306 _date_debut.admin_order_field = 'date_debut'
307
308 def _date_fin(self, obj):
309 return obj.date_fin
310 _date_fin.short_description = u'Occupation fin'
311 _date_fin.admin_order_field = 'date_fin'
312
313 def _poste(self, dossier):
314 link = u"""<a onclick="return showAddAnotherPopup(this);" href='%s'>%s</a> <a href="%s" title="Modifier le poste"><img src="%simg/page_edit.png" /></a>""" % \
315 (reverse('poste_apercu', args=(dossier.poste.id,)),
316 dossier.poste,
317 reverse('admin:rh_poste_change', args=(dossier.poste.id,)),
318 settings.MEDIA_URL,
319 )
320 return link
321 _poste.allow_tags = True
322 _poste.short_description = u'Poste'
323 _poste.admin_order_field = 'poste__nom'
324
325 def _employe(self, obj):
326 employe = obj.employe
327 view_link = reverse('employe_apercu', args=(employe.id,))
328 edit_link = reverse('admin:rh_employe_change', args=(employe.id,))
329
330 if employe.actif == False:
331 style = "color: grey";
332 edit = ""
333 else:
334 style = ""
335 edit = u"""<a href="%s" title="Modifier l'employé"><img src="%simg/user_edit.png" /></a>""" % (edit_link, settings.MEDIA_URL,)
336 return u"""<a onclick="return showAddAnotherPopup(this);" href='%s' style="%s;">[%s] %s %s</a>%s
337 """ % \
338 (view_link, style, employe.id, employe.nom.upper(), employe.prenom.title(), edit)
339 _employe.allow_tags = True
340 _employe.short_description = u"Employé ([code] NOM Prénom)"
341 _employe.admin_order_field = "employe__nom"
342
343 def save_formset(self, request, form, formset, change):
344 instances = formset.save(commit=False)
345 for instance in instances:
346 if instance.__class__ == rh.DossierCommentaire:
347 instance.owner = request.user
348 instance.save()
349
350
351class DossierPieceAdmin(admin.ModelAdmin):
352 pass
353
354
355class DossierCommentaireAdmin(admin.ModelAdmin):
356 pass
357
358
359class EmployeAdmin(AUFMetadataAdminMixin, ProtectRegionMixin, admin.ModelAdmin):
360 alphabet_filter = 'nom'
361 DEFAULT_ALPHABET = u'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
362 search_fields = ('id', 'nom', 'prenom', 'nom_affichage', )
363 ordering = ('nom', )
364 form = EmployeAdminForm
365 list_display = ('_nom', '_dossiers', 'date_modification', 'user_modification', 'actif',)
366 list_filter = ('rh_dossiers__poste__implantation__region', 'rh_dossiers__poste__implantation', 'actif', )
367 inlines = (AyantDroitInline,
368 DossierROInline,
369 EmployePieceInline,
370 EmployeCommentaireInline)
371 fieldsets = AUFMetadataAdminMixin.fieldsets + (
372 ('Identification', {
373 'fields': (('nom', 'prenom'), ('nom_affichage', 'genre'), 'nationalite', 'date_naissance', )
374 }),
375 ('Informations personnelles', {
376 'fields': ('situation_famille', 'date_entree', )
377 }),
378 ('Coordonnées', {
379 'fields': (('tel_domicile', 'tel_cellulaire'), ('adresse', 'ville'), ('code_postal', 'province'), 'pays', )
380 }),
381 )
382
383 def _nom(self, obj):
384 view_link = reverse('employe_apercu', args=(obj.id,))
385 edit_link = reverse('admin:rh_employe_change', args=(obj.id,))
386 return u"""<a onclick="return showAddAnotherPopup(this);" href='%s'>[%s] %s %s</a>
387 <a href="%s" title="Modifier l'employé"><img src="%simg/user_edit.png" /></a>""" % \
388 (view_link, obj.id, obj.nom.upper(), obj.prenom.title(), edit_link, settings.MEDIA_URL,)
389 _nom.allow_tags = True
390 _nom.short_description = u"Employé ([code] NOM Prénom)"
391 _nom.admin_order_field = "nom"
392
393 def _dossiers(self, obj):
394 l = []
395 for d in obj.rh_dossiers.all().order_by('-date_debut'):
396 style = ""
397 edit = u"""<a href="%s" title="Modifier le dossier"><img src="%simg/page_edit.png" /></a>""" % (reverse('admin:rh_dossier_change', args=(d.id,)), settings.MEDIA_URL,)
398 if d.date_fin is not None:
399 edit = ""
400 style = u"color: grey";
401 link = u"""<li><a style="%s;" onclick="return showAddAnotherPopup(this);" href='%s'>%s : %s</a>%s</li>""" % \
402 (style,
403 reverse('dossier_apercu', args=(d.id,)),
404 d.date_debut.year,
405 d.poste,
406 edit,
407 )
408 l.append(link)
409 return "<ul>%s</ul>" % "\n".join(l)
410 _dossiers.allow_tags = True
411 _dossiers.short_description = u"Dossiers"
412
413 def queryset(self, request):
414 qs = super(EmployeAdmin, self).queryset(request)
415 return qs.select_related(depth=1).order_by('nom')
416
417 def save_formset(self, request, form, formset, change):
418 instances = formset.save(commit=False)
419 for instance in instances:
420 if instance.__class__ == rh.EmployeCommentaire:
421 instance.owner = request.user
422 instance.save()
423
424
425
426class EmployeCommentaireAdmin(admin.ModelAdmin):
427 pass
428
429
430class EmployePieceAdmin(admin.ModelAdmin):
431 pass
432
433
434class FamilleEmploiAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 435 list_display = ('nom', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
436 inlines = (TypePosteInline,)
437 fieldsets = AUFMetadataAdminMixin.fieldsets + (
438 (None, {
439 'fields': ('nom', )
440 }),
441 )
442
443
444class OrganismeBstgAdmin(AUFMetadataAdminMixin, ProtectRegionMixin, admin.ModelAdmin):
c5964dc2
OL
445 search_fields = ('nom',)
446 list_display = ('nom', 'type', 'pays', 'date_modification', 'user_modification', 'actif', )
447 list_filter = ('type', )
53ae644d
OL
448 inlines = (DossierROInline,)
449 fieldsets = AUFMetadataAdminMixin.fieldsets + (
450 (None, {
451 'fields': ('nom', 'type', 'pays', )
452 }),
453 )
454
455
456class PosteAdmin(AUFMetadataAdminMixin, ProtectRegionMixin, admin.ModelAdmin, AjaxSelect):
457 form = make_ajax_form(rh.Poste, {
458 'implantation' : 'implantations',
459 'type_poste' : 'typepostes',
460 'responsable' : 'postes',
461 'valeur_point_min' : 'valeurpoints',
462 'valeur_point_max' : 'valeurpoints',
463 })
464 alphabet_filter = 'nom'
465 search_fields = ('nom',
466 'implantation__code',
467 'implantation__nom',
468 'implantation__region__code',
469 'implantation__region__nom',
470 )
471 list_display = (
472 '_nom',
473 '_occupe_par',
474 'implantation',
c5964dc2 475 '_service',
53ae644d
OL
476 'date_debut',
477 'date_fin',
478 'date_modification',
479 'user_modification',
480 'actif',
481 )
482 list_filter = ('service',
483 'implantation__region',
484 'implantation',
485 'type_poste',
486 'type_poste__famille_emploi',
4c53dda4 487 'vacant',
53ae644d
OL
488 'actif',
489 )
490 fieldsets = AUFMetadataAdminMixin.fieldsets + (
491 (None, {
492 'fields': (('nom', 'nom_feminin'), 'implantation', 'type_poste',
493 'service', 'responsable')
494 }),
495 ('Contrat', {
496 'fields': (('regime_travail', 'regime_travail_nb_heure_semaine'), )
497 }),
498 ('Recrutement', {
499 'fields': (('local', 'expatrie', 'mise_a_disposition', 'appel'),)
500 }),
501 ('Rémunération', {
502 'fields': (('classement_min', 'valeur_point_min', 'devise_min', 'salaire_min', 'indemn_min', 'autre_min', ),
503 ('classement_max', 'valeur_point_max' ,'devise_max', 'salaire_max', 'indemn_max', 'autre_max', ),
504 )
505 }),
506 ('Comparatifs de rémunération', {
507 'fields': ('devise_comparaison',
508 ('comp_locale_min', 'comp_locale_max'),
509 ('comp_universite_min', 'comp_universite_max'),
510 ('comp_fonctionpub_min', 'comp_fonctionpub_max'),
511 ('comp_ong_min', 'comp_ong_max'),
512 ('comp_autre_min', 'comp_autre_max'))
513 }),
514 ('Justification', {
515 'fields': ('justification',)
516 }),
517 ('Autres Metadata', {
518 'fields': ('date_debut', 'date_fin')
519 }),
520 )
521
522 inlines = (PosteFinancementInline,
523 PostePieceInline,
524 DossierROInline,
525 PosteCommentaireInline, )
526
c5964dc2
OL
527
528 def _service(self, obj):
529 return obj.service
53ae644d
OL
530
531 def _nom(self, poste):
532 link = u"""<a onclick="return showAddAnotherPopup(this);" href='%s'>%s</a> <a href="%s" title="Modifier le poste"><img src="%simg/page_edit.png" /></a>""" % \
533 (reverse('poste_apercu', args=(poste.id,)),
534 poste.nom,
535 reverse('admin:rh_poste_change', args=(poste.id,)),
536 settings.MEDIA_URL,
537 )
538 return link
539 _nom.allow_tags = True
540 _nom.short_description = u'Nom'
541 _nom.admin_order_field = 'nom'
542
543 def _occupe_par(self, obj):
544 """Formatte la méthode Poste.occupe_par() pour l'admin"""
545 output = "VACANT"
546 employes = obj.occupe_par()
547 if employes:
548 l = []
549 for e in employes:
550 link = "<a href='%s'>%s</a>" % \
551 (reverse('admin:rh_employe_change', args=(e.id,)),
552 e)
553 l.append(link)
554 output = "\n<br />".join(l)
555 return output
556 _occupe_par.allow_tags = True
557 _occupe_par.short_description = "Occupé par"
558
559 def save_formset(self, request, form, formset, change):
560 instances = formset.save(commit=False)
561 for instance in instances:
562 if instance.__class__ == rh.PosteCommentaire:
563 instance.owner = request.user
564 instance.save()
565 formset.save_m2m()
566
567
568class PosteCommentaireAdmin(admin.ModelAdmin):
569 pass
570
571
572class PosteFinancementAdmin(admin.ModelAdmin):
573 pass
574
575
576class PostePieceAdmin(admin.ModelAdmin):
577 fk_name = 'poste'
578
579
580class RemunerationAdmin(admin.ModelAdmin):
581 pass
582
583
584class ResponsableImplantationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
585 fieldsets = AUFMetadataAdminMixin.fieldsets + (
586 (None, {
587 'fields': ('employe', 'implantation', ),
588 }),
589 )
590
591
592class ServiceAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 593 list_display = ('nom', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
594 fieldsets = AUFMetadataAdminMixin.fieldsets + (
595 (None, {
596 'fields': ('nom', ),
597 }),
598 )
599
600class StatutAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 601 list_display = ('code', 'nom', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
602 fieldsets = AUFMetadataAdminMixin.fieldsets + (
603 (None, {
604 'fields': ('code', 'nom', ),
605 }),
606 )
607
608class TauxChangeAdmin(admin.ModelAdmin):
c5964dc2 609 list_display = ('taux', 'devise', 'annee', 'date_modification', 'user_modification', )
53ae644d
OL
610 list_filter = ('devise', )
611 fieldsets = AUFMetadataAdminMixin.fieldsets + (
612 (None, {
613 'fields': ('taux', 'devise', 'annee', ),
614 }),
615 )
616
617class TypeContratAdmin(admin.ModelAdmin):
c5964dc2 618 list_display = ('nom', 'nom_long', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
619 fieldsets = AUFMetadataAdminMixin.fieldsets + (
620 (None, {
621 'fields': ('nom', 'nom_long', ),
622 }),
623 )
624
625
626class TypePosteAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
627 search_fields = ('nom', 'nom_feminin', )
c5964dc2 628 list_display = ('nom', 'famille_emploi', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
629 list_filter = ('famille_emploi', )
630 fieldsets = AUFMetadataAdminMixin.fieldsets + (
631 (None, {
632 'fields': ('nom', 'nom_feminin', 'is_responsable', 'famille_emploi', )
633 }),
634 )
635
636
637class TypeRemunerationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 638 list_display = ('nom', 'type_paiement', 'nature_remuneration', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
639 fieldsets = AUFMetadataAdminMixin.fieldsets + (
640 (None, {
641 'fields': ('nom', 'type_paiement', 'nature_remuneration', )
642 }),
643 )
644
645
646class TypeRevalorisationAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2 647 list_display = ('nom', 'date_modification', 'user_modification', 'actif', )
53ae644d
OL
648 fieldsets = AUFMetadataAdminMixin.fieldsets + (
649 (None, {
650 'fields': ('nom', )
651 }),
652 )
653
654
655class ValeurPointAdmin(AUFMetadataAdminMixin, admin.ModelAdmin):
c5964dc2
OL
656 list_display = ('_devise_code', '_devise_nom', 'annee', 'valeur', 'date_modification', 'user_modification', )
657 list_filter = ('annee', 'devise', )
53ae644d
OL
658 fieldsets = AUFMetadataAdminMixin.fieldsets + (
659 (None, {
660 'fields': ('valeur', 'devise', 'implantation', 'annee', )
661 }),
662 )
663
664 def _devise_code(self, obj):
665 return obj.devise.code
666 _devise_code.short_description = "Code de la devise"
667
668 def _devise_nom(self, obj):
669 return obj.devise.nom
670 _devise_nom.short_description = "Nom de la devise"
671
672
673admin.site.register(rh.Classement, ClassementAdmin)
674admin.site.register(rh.Devise, DeviseAdmin)
675admin.site.register(rh.Dossier, DossierAdmin)
676admin.site.register(rh.Employe, EmployeAdmin)
677admin.site.register(rh.FamilleEmploi, FamilleEmploiAdmin)
678admin.site.register(rh.OrganismeBstg, OrganismeBstgAdmin)
679admin.site.register(rh.Poste, PosteAdmin)
680admin.site.register(rh.ResponsableImplantation, ResponsableImplantationAdmin)
681admin.site.register(rh.Service, ServiceAdmin)
c5964dc2 682admin.site.register(rh.Statut, StatutAdmin)
53ae644d 683admin.site.register(rh.TauxChange, TauxChangeAdmin)
c5964dc2 684admin.site.register(rh.TypeContrat, TypeContratAdmin)
53ae644d
OL
685admin.site.register(rh.TypePoste, TypePosteAdmin)
686admin.site.register(rh.TypeRemuneration, TypeRemunerationAdmin)
687admin.site.register(rh.TypeRevalorisation, TypeRevalorisationAdmin)
688admin.site.register(rh.ValeurPoint, ValeurPointAdmin)