diff options
| author | jbm-odoo <jbm@odoo.com> | 2018-12-13 11:10:15 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-01-21 11:29:30 +0000 |
| commit | a3daff6bc121a42bf293ca91b8f522c26bac7c8a (patch) | |
| tree | 7cdc12fc34bf66068e51970bb60f946c06c30a7e /addons/resource | |
| parent | 344877a0813a915344a230f1aaf1f932f2f9d5cb (diff) | |
[IMP] hr_holidays: Rename 'leave' into 'time off' + add dashboard
Purpose
=======
We need to use an international word to define holidays and leaves, rename everything into Time Off.
Employees needs a good dashboard and leaves summary
Specification
=============
1/ Add a new dashboard: https://balsamiq.cloud/sm5j0d/pg5w04r
Create a new dashboard with a calendar and a summary of all time off and time off request
2/ Rename leaves into Time Off everywhere
3/ Improve general usability
TaskID: 1916871
closes odoo/odoo#29634
Diffstat (limited to 'addons/resource')
| -rw-r--r-- | addons/resource/models/resource.py | 14 | ||||
| -rw-r--r-- | addons/resource/views/resource_views.xml | 12 |
2 files changed, 13 insertions, 13 deletions
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 @@ <field name="name">resource.calendar.leaves.search</field> <field name="model">resource.calendar.leaves</field> <field name="arch" type="xml"> - <search string="Search Working Period Leaves"> + <search string="Search Working Period Time Off"> <field name="name"/> <field name="resource_id"/> <field name="company_id" groups="base.group_multi_company"/> @@ -147,14 +147,14 @@ </record> <record id="action_resource_calendar_leave_tree" model="ir.actions.act_window"> - <field name="name">Resource Leaves</field> + <field name="name">Resource Time Off</field> <field name="res_model">resource.calendar.leaves</field> <field name="view_mode">tree,form,calendar</field> <field name="search_view_id" ref="view_resource_calendar_leaves_search"/> </record> <record id="resource_calendar_leaves_action_from_calendar" model="ir.actions.act_window"> - <field name="name">Resource Leaves</field> + <field name="name">Resource Time Off</field> <field name="res_model">resource.calendar.leaves</field> <field name="view_mode">tree,form,calendar</field> <field name="context">{ @@ -174,7 +174,7 @@ <act_window id="resource_calendar_resources_leaves" - name="Resources Leaves" + name="Resources Time Off" res_model="resource.calendar.leaves" src_model="resource.calendar" view_mode="calendar,tree,form" @@ -239,7 +239,7 @@ <sheet string="Working Time"> <div class="oe_button_box" name="button_box"> <button name="%(resource_calendar_leaves_action_from_calendar)d" type="action" - string="Leaves" icon="fa-calendar-times-o" + string="Time Off" icon="fa-calendar-times-o" class="oe_stat_button" groups="base.group_no_one"/> <button name="%(resource_resource_action_from_calendar)d" type="action" @@ -261,7 +261,7 @@ <page string="Working Hours" name="working_hours"> <field name="attendance_ids"/> </page> - <page string="Global Leaves" name="global_leaves"> + <page string="Global Time Off" name="global_leaves"> <field name="global_leave_ids"> <tree editable="top"> <field name="name"/> |
