from datetime import date
from decimal import Decimal
-from django.db.models import signals
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.conf import settings
-from django.db.models import Q
from auf.django.emploi.models import GENRE_CHOICES, SITUATION_CHOICES # devrait plutot être dans references
from auf.django.metadata.models import AUFMetadata
self.id)
return representation
+
prefix_implantation = "implantation__region"
def get_regions(self):
return [self.implantation.region]
verbose_name = u"Employé commentaire"
verbose_name_plural = u"Employé commentaires"
-class EmployeProxy(Employe):
-
- class Meta:
- proxy = True
- verbose_name = u"Organigramme des employés"
- verbose_name_plural = u"Organigramme des employés"
LIEN_PARENTE_CHOICES = (
('Conjoint', 'Conjoint'),
except:
return None
+
class Dossier(Dossier_):
__doc__ = Dossier_.__doc__
poste = models.ForeignKey('%s.Poste' % app_context(),
"""Documents relatifs au Dossier (à l'occupation de ce poste par employé).
Ex.: Lettre de motivation.
"""
- dossier = models.ForeignKey('%s.Dossier' % app_context(), db_column='dossier', related_name='+')
+ dossier = models.ForeignKey('%s.Dossier' % app_context(), db_column='dossier', related_name='%(app_label)s_dossierpieces')
nom = models.CharField(verbose_name = u"Nom", max_length=255)
fichier = models.FileField(verbose_name = u"Fichier",
upload_to=dossier_piece_dispatch,
abstract = True
def taux_devise(self):
- annee = self.dossier.poste.date_debut.year
+ annee = self.dossier.contrat_date_debut.year
taux = [tc.taux for tc in TauxChange.objects.filter(devise=self.devise, annee=annee)]
taux = set(taux)
if len(taux) != 1:
return 1
annee = datetime.datetime.now().year
- if self.date_debut is not None:
- annee = self.date_debut.year
if self.dossier.poste.date_debut is not None:
annee = self.dossier.poste.date_debut.year
+ if self.dossier.date_debut is not None:
+ annee = self.dossier.date_debut.year
+ if self.date_debut is not None:
+ annee = self.date_debut.year
taux = [tc.taux for tc in TauxChange.objects.filter(devise=self.devise_id, annee=annee)]
taux = set(taux)
if len(taux) != 1:
- raise Exception(u"Le taux de la devise %s n'a pas n'existe pas pour %s ou il existe plusieurs taux pour la même année" % (self.devise.id, annee))
+ raise Exception(u"Le taux de la devise %s n'a pas n'existe pas pour %s ou il existe plusieurs taux pour la même année %s (%s)" % (self.devise.code, annee, taux, self.dossier))
else:
return list(taux)[0]
verbose_name_plural = u"Classements"
def __unicode__(self):
- return u'%s.%s.%s (%s)' % (self.type, self.echelon, self.degre,
- self.coefficient)
+ return u'%s.%s.%s' % (self.type, self.echelon, self.degre, )
class Classement(Classement_):
__doc__ = Classement_.__doc__