- Validated leaves create timesheets automatically.
+ Validated time off create timesheets automatically.
diff --git a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py
index 55de72da165..85d48f5475e 100644
--- a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py
+++ b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py
@@ -61,7 +61,7 @@ class HrContract(models.Model):
meal_voucher_amount = fields.Monetary(string="Meal Vouchers",
tracking=True,
help="Amount the employee receives in the form of meal vouchers per worked day.")
- holidays = fields.Float(string='Legal Leaves',
+ holidays = fields.Float(string='Paid Time Off',
help="Number of days of paid leaves the employee gets per year.")
holidays_editable = fields.Boolean(string="Editable Leaves", default=True)
holidays_compensation = fields.Monetary(compute='_compute_holidays_compensation', string="Holidays Compensation")
diff --git a/addons/l10n_be_hr_payroll/models/res_config_settings.py b/addons/l10n_be_hr_payroll/models/res_config_settings.py
index ee6bcb33004..d4effc79cd0 100644
--- a/addons/l10n_be_hr_payroll/models/res_config_settings.py
+++ b/addons/l10n_be_hr_payroll/models/res_config_settings.py
@@ -6,7 +6,7 @@ from odoo import api, fields, models, _
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
- default_holidays = fields.Float(string="Legal Leaves", default_model="hr.contract")
+ default_holidays = fields.Float(string="Paid Time Off", default_model="hr.contract")
default_commission_on_target = fields.Float(string="Commission on Target", default_model="hr.contract")
default_fuel_card = fields.Float(string="Fuel Card", default_model="hr.contract")
default_representation_fees = fields.Float(string="Representation Fees", default_model="hr.contract")
diff --git a/addons/l10n_be_hr_payroll_account/data/l10n_be_hr_payroll_account_demo.xml b/addons/l10n_be_hr_payroll_account/data/l10n_be_hr_payroll_account_demo.xml
index bbdf147e957..2a8d28e2292 100644
--- a/addons/l10n_be_hr_payroll_account/data/l10n_be_hr_payroll_account_demo.xml
+++ b/addons/l10n_be_hr_payroll_account/data/l10n_be_hr_payroll_account_demo.xml
@@ -75,7 +75,7 @@
- Legal leave
+ Paid Time Off
LEAVE100
4
32
@@ -140,7 +140,7 @@
- Sick Leave
+ Sick Time Off
LEAVE200
1
8
diff --git a/addons/project_timesheet_holidays/__manifest__.py b/addons/project_timesheet_holidays/__manifest__.py
index d98cef28b51..81a64d7f735 100644
--- a/addons/project_timesheet_holidays/__manifest__.py
+++ b/addons/project_timesheet_holidays/__manifest__.py
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
- 'name': 'Timesheet when on Leaves',
+ 'name': 'Timesheet when on Time Off',
'version': '1.0',
'category': 'Human Resources',
- 'summary': 'Schedule timesheet when on leaves',
+ 'summary': 'Schedule timesheet when on time off',
'description': """
Bridge module to integrate leaves in timesheet
================================================
diff --git a/addons/project_timesheet_holidays/models/hr_holidays.py b/addons/project_timesheet_holidays/models/hr_holidays.py
index 75d4f47026b..c1463b49a27 100644
--- a/addons/project_timesheet_holidays/models/hr_holidays.py
+++ b/addons/project_timesheet_holidays/models/hr_holidays.py
@@ -16,26 +16,38 @@ class HolidaysType(models.Model):
company = self.company_id if self.company_id else self.env.user.company_id
return company.leave_timesheet_task_id.id
- timesheet_generate = fields.Boolean('Generate Timesheet', default=True, help="If checked, when validating a leave, timesheet will be generated in the Vacation Project of the company.")
- timesheet_project_id = fields.Many2one('project.project', string="Internal Project", default=_default_project_id, help="The project will contain the timesheet generated when a leave is validated.")
- timesheet_task_id = fields.Many2one('project.task', string="Internal Task for timesheet", default=_default_task_id, domain="[('project_id', '=', timesheet_project_id)]")
+ timesheet_generate = fields.Boolean('Generate Timesheet', default=True, help="If checked, when validating a time off, timesheet will be generated in the Vacation Project of the company.")
+ timesheet_project_id = fields.Many2one('project.project', string="Project", default=_default_project_id, help="The project will contain the timesheet generated when a time off is validated.")
+ timesheet_task_id = fields.Many2one('project.task', string="Task for timesheet", default=_default_task_id, domain="[('project_id', '=', timesheet_project_id)]")
- @api.onchange('timesheet_generate')
+ @api.onchange('timesheet_task_id')
def _onchange_timesheet_generate(self):
- if self.timesheet_generate:
- company = self.company_id if self.company_id else self.env.user.company_id
- self.timesheet_project_id = company.leave_timesheet_project_id
- self.timesheet_task_id = company.leave_timesheet_task_id
+ if self.timesheet_task_id or self.timesheet_project_id:
+ self.timesheet_generate = True
else:
- self.timesheet_project_id = False
- self.timesheet_task_id = False
+ self.timesheet_generate = False
- @api.constrains('timesheet_generate')
+ @api.onchange('timesheet_project_id')
+ def _onchange_timesheet_project(self):
+ company = self.company_id if self.company_id else self.env.user.company_id
+ default_task_id = company.leave_timesheet_task_id
+ if default_task_id and default_task_id.project_id == self.timesheet_project_id:
+ self.timesheet_task_id = default_task_id
+ else:
+ self.timesheet_task_id = False
+ if self.timesheet_project_id:
+ self.timesheet_generate = True
+ else:
+ self.timesheet_generate = False
+
+ @api.constrains('timesheet_generate', 'timesheet_project_id', 'timesheet_task_id')
def _check_timesheet_generate(self):
for holiday_status in self:
if holiday_status.timesheet_generate:
if not holiday_status.timesheet_project_id or not holiday_status.timesheet_task_id:
- raise ValidationError(_('Both the internal project and task are required to generate timesheet for the leaves.'))
+ raise ValidationError(_('Both the internal project and task are required to\
+ generate timesheet for the time of. If you don\'t want timesheet, you must let\
+ empty internal project and task.'))
class Holidays(models.Model):
diff --git a/addons/project_timesheet_holidays/models/res_company.py b/addons/project_timesheet_holidays/models/res_company.py
index 0eb9e4e3686..948b4f3bffa 100644
--- a/addons/project_timesheet_holidays/models/res_company.py
+++ b/addons/project_timesheet_holidays/models/res_company.py
@@ -9,9 +9,9 @@ class Company(models.Model):
leave_timesheet_project_id = fields.Many2one(
'project.project', string="Internal Project",
- help="Default project value for timesheet generated from leave type.")
+ help="Default project value for timesheet generated from time off type.")
leave_timesheet_task_id = fields.Many2one(
- 'project.task', string="Leave Task",
+ 'project.task', string="Time Off Task",
domain="[('project_id', '=', leave_timesheet_project_id)]")
def init(self):
@@ -37,7 +37,7 @@ class Company(models.Model):
})
if not company.leave_timesheet_task_id:
task = self.env['project.task'].sudo().create({
- 'name': _('Leaves'),
+ 'name': _('Time Off'),
'project_id': company.leave_timesheet_project_id.id,
'active': False,
'company_id': False,
diff --git a/addons/project_timesheet_holidays/models/res_config_settings.py b/addons/project_timesheet_holidays/models/res_config_settings.py
index 60b56b39bae..bbc0b0a12ce 100644
--- a/addons/project_timesheet_holidays/models/res_config_settings.py
+++ b/addons/project_timesheet_holidays/models/res_config_settings.py
@@ -8,4 +8,4 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
leave_timesheet_project_id = fields.Many2one(related='company_id.leave_timesheet_project_id', string="Internal Project", readonly=False)
- leave_timesheet_task_id = fields.Many2one(related='company_id.leave_timesheet_task_id', string="Leave Task", readonly=False)
+ leave_timesheet_task_id = fields.Many2one(related='company_id.leave_timesheet_task_id', string="Time Off Task", readonly=False)
diff --git a/addons/project_timesheet_holidays/views/hr_holidays_views.xml b/addons/project_timesheet_holidays/views/hr_holidays_views.xml
index a74b6aca55a..845b3e11905 100644
--- a/addons/project_timesheet_holidays/views/hr_holidays_views.xml
+++ b/addons/project_timesheet_holidays/views/hr_holidays_views.xml
@@ -6,10 +6,13 @@
hr.leave.type
-
-
-
-
+
+
+
+
+
+
+
diff --git a/addons/resource/models/resource.py b/addons/resource/models/resource.py
index 54575a6c354..28d16768a47 100644
--- a/addons/resource/models/resource.py
+++ b/addons/resource/models/resource.py
@@ -174,9 +174,9 @@ class ResourceCalendar(models.Model):
'resource.calendar.attendance', 'calendar_id', 'Working Time',
copy=True, default=_get_default_attendance_ids)
leave_ids = fields.One2many(
- 'resource.calendar.leaves', 'calendar_id', 'Leaves')
+ 'resource.calendar.leaves', 'calendar_id', 'Time Off')
global_leave_ids = fields.One2many(
- 'resource.calendar.leaves', 'calendar_id', 'Global Leaves',
+ 'resource.calendar.leaves', 'calendar_id', 'Global Time Off',
domain=[('resource_id', '=', False)]
)
hours_per_day = fields.Float("Average Hour per Day", default=HOURS_PER_DAY,
@@ -506,7 +506,7 @@ class ResourceResource(models.Model):
class ResourceCalendarLeaves(models.Model):
_name = "resource.calendar.leaves"
- _description = "Resource Leaves Detail"
+ _description = "Resource Time Off Detail"
name = fields.Char('Reason')
company_id = fields.Many2one(
@@ -517,14 +517,14 @@ class ResourceCalendarLeaves(models.Model):
date_to = fields.Datetime('End Date', required=True)
resource_id = fields.Many2one(
"resource.resource", 'Resource',
- help="If empty, this is a generic holiday for the company. If a resource is set, the holiday/leave is only for this resource")
- time_type = fields.Selection([('leave', 'Leave'), ('other', 'Other')], default='leave',
- help="Whether this should be computed as a holiday or as work time (eg: formation)")
+ help="If empty, this is a generic time off for the company. If a resource is set, the time off is only for this resource")
+ time_type = fields.Selection([('leave', 'Time Off'), ('other', 'Other')], default='leave',
+ help="Whether this should be computed as a time off or as work time (eg: formation)")
@api.constrains('date_from', 'date_to')
def check_dates(self):
if self.filtered(lambda leave: leave.date_from > leave.date_to):
- raise ValidationError(_('The start date of the leave must be earlier end date.'))
+ raise ValidationError(_('The start date of the time off must be earlier end date.'))
@api.onchange('resource_id')
def onchange_resource(self):
diff --git a/addons/resource/views/resource_views.xml b/addons/resource/views/resource_views.xml
index ded427f2901..987e78d3785 100644
--- a/addons/resource/views/resource_views.xml
+++ b/addons/resource/views/resource_views.xml
@@ -86,7 +86,7 @@
resource.calendar.leaves.search
resource.calendar.leaves
-
+
@@ -147,14 +147,14 @@
- Resource Leaves
+ Resource Time Off
resource.calendar.leaves
tree,form,calendar
- Resource Leaves
+ Resource Time Off
resource.calendar.leaves
tree,form,calendar
{
@@ -174,7 +174,7 @@