obj = super(StatutForm, self).save(*args, **kwargs)
self.wf.content_object = obj
self.wf.etat_final = obj.etat
- commentaire = u"%s => %s : %s" % (self.wf.etat_initial,
- self.wf.etat_final,
+ commentaire = u"%s => %s : %s" % (
+ self.wf.get_etat_label(self.wf.etat_initial),
+ self.wf.get_etat_label(self.wf.etat_final),
self.data['commentaire'])
self.wf.texte = commentaire
self.wf.save()
def _etat(self, obj):
return obj.get_etat_display()
-
+ _etat.short_description = "État"
+ _etat.admin_order_field = "etat"
class DossierStatutAdmin(StatutAdmin):
search_fields = ('employe__nom', 'employe__prenom', 'poste__nom', )
list_display = ('_poste', '_implantation', 'employe', '_etat', )
+ list_filter = ('poste__implantation', )
form = StatutDossierForm
def _poste(self, obj):
def _implantation(self, obj):
return obj.poste.implantation
-
+ _implantation.short_description = u"Implantation"
+ _implantation.admin_order_field = "poste__implantation"
class PosteStatutAdmin(StatutAdmin):
search_fields = ('nom', )
- list_display = ('nom', 'implantation', '_etat', )
+ list_display = ('nom', 'implantation', )
+ list_filter = ('implantation', 'etat', )
form = StatutPosteForm
def _etat(self, obj):
return obj.get_etat_display()
+ _etat.short_description = u"État"
+ _etat.admin_order_field = "etat"
def has_delete_permission(self, request, obj=None):
return False
class ImportDossierAdmin(ImportAdmin):
search_fields = ('employe__nom', 'employe__prenom', 'poste__nom', )
- list_display = ('_poste', '_implantation', '_employe', '_dae',)
+ list_display = ('_poste', '_implantation', '_employe', '_dae', '_etat')
list_filter = ('poste__implantation', 'etat', )
actions = ['importer_dans_RH', ]
def _implantation(self, obj):
return obj.poste.implantation
+ _implantation.short_description = u"Implantation"
+ _implantation.admin_order_field = "poste__implantation"
def _dae(self, obj):
url = reverse('embauche_consulter', args=(obj.id, ))
def _implantation(self, obj):
return obj.implantation
+ _implantation.short_description = u"Implantation"
+ _implantation.admin_order_field = "implantation"
def _dae(self, obj):
url = reverse('poste_consulter', args=("dae-%s" % obj.id, ))