Skip to content
Snippets Groups Projects

Ajout d'un temps de déplacement sur la ligne de temps

Merged Hervé Silvant - CGScop requested to merge hsilvant/cgscop_timesheet:14-RV-20250129 into 14.0
4 files
+ 38
1
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 15
1
@@ -80,7 +80,13 @@ class ScopHrTimesheet(models.Model):
@@ -80,7 +80,13 @@ class ScopHrTimesheet(models.Model):
string="Heures supplémentaires autorisées",
string="Heures supplémentaires autorisées",
compute="_compute_overtime_allowed",
compute="_compute_overtime_allowed",
)
)
travel_time = fields.Float(
 
string="Temps déplacement",
 
)
 
is_travel_time_allowed = fields.Boolean(
 
string="Temps de déplacement autorisé",
 
compute="_compute_travel_time_allowed",
 
)
calendar_l1 = fields.Char(
calendar_l1 = fields.Char(
string="Ligne 1 calendrier",
string="Ligne 1 calendrier",
compute="_compute_calendar_l1",
compute="_compute_calendar_l1",
@@ -98,6 +104,11 @@ class ScopHrTimesheet(models.Model):
@@ -98,6 +104,11 @@ class ScopHrTimesheet(models.Model):
for rec in self:
for rec in self:
rec.is_overtime_allowed = self.env.company.overtime_working
rec.is_overtime_allowed = self.env.company.overtime_working
 
@api.depends("ur_id")
 
def _compute_travel_time_allowed(self):
 
for rec in self:
 
rec.is_travel_time_allowed = self.env.company.use_travel_time
 
@api.depends("ur_id")
@api.depends("ur_id")
def _compute_ur_system_nb(self):
def _compute_ur_system_nb(self):
for timesheet in self:
for timesheet in self:
@@ -285,6 +296,9 @@ class ScopHrTimesheet(models.Model):
@@ -285,6 +296,9 @@ class ScopHrTimesheet(models.Model):
overtime_allowed = self.env.company.overtime_working
overtime_allowed = self.env.company.overtime_working
if not overtime_allowed:
if not overtime_allowed:
custom_context['hide_overtime'] = True
custom_context['hide_overtime'] = True
 
travel_time_allowed = self.env.company.use_travel_time
 
if not travel_time_allowed:
 
custom_context['hide_travel_time'] = True
res = super(ScopHrTimesheet, self.with_context(custom_context)).fields_view_get(
res = super(ScopHrTimesheet, self.with_context(custom_context)).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
Loading