Skip to content
Extraits de code Groupes Projets

Ajout d'une notion d'heures supplémentaires (UR Ouest)

4 files
+ 41
0
Comparer les modifications
  • Côte à côte
  • En ligne

Fichiers

+ 17
0
@@ -72,6 +72,14 @@ class ScopHrTimesheet(models.Model):
string="Lieu",
)
justificatifs = fields.Char(string="Justificatifs", required=False)
is_overtime = fields.Boolean(
string="Heures supplémentaires",
default=False,
)
is_overtime_allowed = fields.Boolean(
string="Heures supplémentaires autorisées",
compute="_compute_overtime_allowed",
)
calendar_l1 = fields.Char(
string="Ligne 1 calendrier",
@@ -85,6 +93,11 @@ class ScopHrTimesheet(models.Model):
# ------------------------------------------------------
# Compute Functions
# ------------------------------------------------------
@api.depends("ur_id")
def _compute_overtime_allowed(self):
for rec in self:
rec.is_overtime_allowed = self.env.company.overtime_working
@api.depends("ur_id")
def _compute_ur_system_nb(self):
for timesheet in self:
@@ -269,6 +282,10 @@ class ScopHrTimesheet(models.Model):
if len(nbrc) == 0:
custom_context['hide_regional_convention'] = True
overtime_allowed = self.env.company.overtime_working
if not overtime_allowed:
custom_context['hide_overtime'] = True
res = super(ScopHrTimesheet, self.with_context(custom_context)).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
Chargement en cours