Compare commits
2 Commits
3bfe2752b5
...
f7c7496492
| Author | SHA1 | Date | |
|---|---|---|---|
| f7c7496492 | |||
| fd5e0f2f44 |
@@ -31,12 +31,12 @@ class HrTimesheetSheet(models.Model):
|
|||||||
sheet.timesheet_sheet_recovery_hours = sheet._get_timesheet_sheet_recovery_hours()
|
sheet.timesheet_sheet_recovery_hours = sheet._get_timesheet_sheet_recovery_hours()
|
||||||
|
|
||||||
def _get_timesheet_sheet_gap_hours(self):
|
def _get_timesheet_sheet_gap_hours(self):
|
||||||
for sheet in self:
|
self.ensure_one()
|
||||||
timesheet_sheet_gap_hours = sum(
|
timesheet_sheet_gap_hours = sum(
|
||||||
sheet.employee_stats_ids.filtered(
|
self.employee_stats_ids.filtered(
|
||||||
lambda stat: stat.date <= fields.Date.today()
|
lambda stat: stat.date <= fields.Date.today()
|
||||||
).mapped("gap_hours")
|
).mapped("gap_hours")
|
||||||
)
|
)
|
||||||
return timesheet_sheet_gap_hours
|
return timesheet_sheet_gap_hours
|
||||||
|
|
||||||
def _get_timesheet_sheet_recovery_hours(self):
|
def _get_timesheet_sheet_recovery_hours(self):
|
||||||
@@ -189,7 +189,7 @@ class HrTimesheetSheet(models.Model):
|
|||||||
|
|
||||||
if not employee_id or not recovery_type_id:
|
if not employee_id or not recovery_type_id:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
_("Employe not defined for the timesheet sheet or recovery type not defined in settings")
|
_("Employee not defined for the timesheet sheet or recovery type not defined in settings")
|
||||||
)
|
)
|
||||||
if recovery_type_id.request_unit != 'hour' or not recovery_type_id.allows_negative:
|
if recovery_type_id.request_unit != 'hour' or not recovery_type_id.allows_negative:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
|
|||||||
Reference in New Issue
Block a user