Maintainers
+Maintainers
This module is maintained by the OCA.

diff --git a/hr_planning_resources/README.rst b/hr_planning_resources/README.rst
index 398d311..a9f9812 100644
--- a/hr_planning_resources/README.rst
+++ b/hr_planning_resources/README.rst
@@ -28,12 +28,24 @@ HR Resource Planner
|badge1| |badge2| |badge3| |badge4| |badge5|
+This module is designed to improve human resources planning and management within an organization.
+It's provides advanced tools for task scheduling, permission management, and resource planning,
+allowing managers and employees to organize and visualize their schedules efficiently.
**Table of contents**
.. contents::
:local:
+Usage
+=====
+
+1. Navigate to the "Planning" section in the main menu.
+2. Select "My Planning" to view your assigned tasks.
+3. To assign a new task, select "My Planning", click on the New button.
+4. You can assign it from the same task, ticket or project using the assign to planning button.
+5. In the task, if the "Force recalculation" checkbox is checked, all hours that have elapsed will be calculated.
+
Bug Tracker
===========
diff --git a/hr_planning_resources/__manifest__.py b/hr_planning_resources/__manifest__.py
index c5c7163..77168d3 100644
--- a/hr_planning_resources/__manifest__.py
+++ b/hr_planning_resources/__manifest__.py
@@ -3,13 +3,10 @@
"summary": "",
"version": "16.0.1.0.7",
"category": "Human Resources",
- "website": "https://github.com/BinhexTeam/",
- "author": "Binhex",
+ "website": "https://github.com/OCA/resource",
+ "author": "Binhex, Odoo Community Association (OCA)",
"depends": [
- "project",
- "web_timeline",
- "helpdesk_mgmt",
- "hr_holidays",
+ "hr_planning_oca",
],
"data": [
"security/ir.model.access.csv",
diff --git a/hr_planning_resources/i18n/es.po b/hr_planning_resources/i18n/es.po
index db9c452..85eae2e 100644
--- a/hr_planning_resources/i18n/es.po
+++ b/hr_planning_resources/i18n/es.po
@@ -1,20 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * hr_planning_resources
+# * hr_planning_resources
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-26 18:40+0000\n"
-"PO-Revision-Date: 2024-09-26 18:40+0000\n"
+"POT-Creation-Date: 2025-01-06 20:38+0000\n"
+"PO-Revision-Date: 2025-01-06 20:38+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
-"Language: \n"
#. module: hr_planning_resources
#. odoo-python
@@ -24,32 +23,19 @@ msgid " and"
msgstr "Error translating text"
#. module: hr_planning_resources
-#. odoo-python
-#: code:addons/hr_planning_resources/models/hr_leave.py:0
-#, python-format
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.create_hr_task_view_form
msgid ""
-"%(employee)s %(time_off_type)s%(period_leaves)s. \n"
-""
-msgstr "Error translating text"
-
-#. module: hr_planning_resources
-#. odoo-python
-#: code:addons/hr_planning_resources/models/hr_leave.py:0
-#, python-format
-msgid "%(prefix)s from the %(dfrom)s to the %(dto)s"
-msgstr "%(prefix)s del %(dfrom)s al %(dto)s"
-
-#. module: hr_planning_resources
-#. odoo-python
-#: code:addons/hr_planning_resources/models/hr_leave.py:0
-#, python-format
-msgid "%(prefix)s from the %(dfrom_date)s at %(dfrom)sto the %(dto_date)s at %(dto)s"
-msgstr "%(prefix)s del %(dfrom_date)s a las %(dfrom)sto del %(dto_date)s a las %(dto)s"
+"\n"
+" Create a new HR Task for the current user.\n"
+" "
+msgstr ""
#. module: hr_planning_resources
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.hr_task_form_view
-msgid ""
-msgstr ""
+msgid ""
+""
+msgstr ""
#. module: hr_planning_resources
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.res_config_settings_view_form
@@ -62,6 +48,13 @@ msgstr ""
" Tareas recurrentes\n"
" "
+#. module: hr_planning_resources
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.helpdesk_ticket_edit_view_form
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_edit_project_form
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_project_task_form
+msgid "Planning Task"
+msgstr ""
+
#. module: hr_planning_resources
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.res_config_settings_view_form
msgid "months ahead"
@@ -109,17 +102,12 @@ msgstr "Tiempo asignado"
msgid "An shift must be in the same company as its recurrency."
msgstr "Un turno debe estar en la misma empresa que su recurrencia."
-#. module: hr_planning_resources
-#: model_terms:ir.ui.view,arch_db:hr_planning_resources.create_hr_task_view_form
-msgid "Are you sure you want to plan a resource?"
-msgstr "¿Está seguro de que desea planificar un recurso?"
-
#. module: hr_planning_resources
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.helpdesk_ticket_edit_view_form
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_edit_project_form
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_project_task_form
msgid "Assing Planning"
-msgstr "Assing Planning"
+msgstr ""
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__message_attachment_count
@@ -141,7 +129,7 @@ msgstr "Cancelado"
#. module: hr_planning_resources
#: model:ir.model,name:hr_planning_resources.model_res_company
msgid "Companies"
-msgstr "Empresas"
+msgstr "Compañías"
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__company_id
@@ -152,7 +140,7 @@ msgstr "Empresa"
#. module: hr_planning_resources
#: model:ir.model,name:hr_planning_resources.model_res_config_settings
msgid "Config Settings"
-msgstr "Ajustes de configuración"
+msgstr "Opciones de configuración"
#. module: hr_planning_resources
#: model:ir.ui.menu,name:hr_planning_resources.menu_settings
@@ -164,11 +152,6 @@ msgstr "Configuración"
msgid "Confirm"
msgstr "Confirmar"
-#. module: hr_planning_resources
-#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__confirm_delete
-msgid "Confirm tasks Deletion"
-msgstr "Confirmar eliminación de tareas"
-
#. module: hr_planning_resources
#: model:ir.model,name:hr_planning_resources.model_create_hr_task
msgid "Create HR Task"
@@ -229,11 +212,6 @@ msgstr "Correo electrónico cc"
msgid "Employee"
msgstr "Empleado"
-#. module: hr_planning_resources
-#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__is_absent
-msgid "Employees on Time Off"
-msgstr "Empleados en tiempo libre"
-
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__date_end
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__date_end
@@ -308,7 +286,21 @@ msgstr "Recurso de planificación de RR. HH"
#: model:ir.actions.server,name:hr_planning_resources.ir_cron_hr_task_schedule_ir_actions_server
#: model:ir.cron,cron_name:hr_planning_resources.ir_cron_hr_task_schedule
msgid "HR Planning Resources: generate next recurring shifts"
-msgstr "Recursos de planificación de RR. HH.: generar próximos turnos recurrentes"
+msgstr ""
+"Recursos de planificación de RR. HH.: generar próximos turnos recurrentes"
+
+#. module: hr_planning_resources
+#: model:ir.model.fields,field_description:hr_planning_resources.field_helpdesk_ticket__hr_task_count
+#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task_mixin__hr_task_count
+#: model:ir.model.fields,field_description:hr_planning_resources.field_project_project__hr_task_count
+#: model:ir.model.fields,field_description:hr_planning_resources.field_project_task__hr_task_count
+msgid "HR Task Count"
+msgstr ""
+
+#. module: hr_planning_resources
+#: model:ir.model,name:hr_planning_resources.model_hr_task_mixin
+msgid "HR Task Mixin"
+msgstr "hr.task.mixin"
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__has_message
@@ -322,16 +314,15 @@ msgstr "Ticket de Mesa de Servicio"
#. module: hr_planning_resources
#: model:ir.model,name:hr_planning_resources.model_hr_task_recurrency
-msgid "HrTaskRecurrency"
+msgid "Hr Task Recurrency"
msgstr "HrTaskRecurrency"
#. module: hr_planning_resources
-#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__active_id
#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__id
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__id
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task_recurrency__id
msgid "ID"
-msgstr "ID"
+msgstr ""
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__activity_exception_icon
@@ -426,11 +417,6 @@ msgstr "Error de Envío de Mensaje"
msgid "Messages"
msgstr "Mensajes"
-#. module: hr_planning_resources
-#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__res_model
-msgid "Model"
-msgstr "Modelo"
-
#. module: hr_planning_resources
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task__repeat_unit__month
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task_recurrency__repeat_unit__month
@@ -498,6 +484,20 @@ msgstr "Tipo de actividad Siguiente"
msgid "No Of Repetitions of the plannings"
msgstr "Nº de repeticiones de las planificaciones"
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/wizard/create_hr_task.py:0
+#, python-format
+msgid "No active record id provided."
+msgstr ""
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/wizard/create_hr_task.py:0
+#, python-format
+msgid "No default resource model specified."
+msgstr ""
+
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__message_needaction_counter
msgid "Number of Actions"
@@ -524,24 +524,12 @@ msgstr "Número de mensajes que requieren acción"
msgid "Number of messages with delivery error"
msgstr "Número de mensajes con error de envío"
-#. module: hr_planning_resources
-#. odoo-python
-#: code:addons/hr_planning_resources/models/hr_task.py:0
-#, python-format
-msgid "Operation not supported"
-msgstr "Operación no permitida1: the unknown socket address family number"
-
#. module: hr_planning_resources
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task__state__planified
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.hr_task_search_view
msgid "Planified"
msgstr "Planificado"
-#. module: hr_planning_resources
-#: model:ir.ui.menu,name:hr_planning_resources.main_menu_planner
-msgid "Planning"
-msgstr "Planificación"
-
#. module: hr_planning_resources
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.res_config_settings_view_form
msgid "Planning Resources"
@@ -559,6 +547,7 @@ msgstr "Recurso de planificación"
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__project_id
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task__type__project
#: model_terms:ir.ui.view,arch_db:hr_planning_resources.hr_task_search_view
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_edit_project_form
#, python-format
msgid "Project"
msgstr "Proyecto"
@@ -569,6 +558,11 @@ msgstr "Proyecto"
msgid "Rate Of Shift Generation"
msgstr "Tasa de generación de turnos"
+#. module: hr_planning_resources
+#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__is_recompute_forced
+msgid "Recompute Forced?"
+msgstr "Forzar recalculo"
+
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__recurrency_id
msgid "Recurrency"
@@ -685,6 +679,19 @@ msgstr ""
msgid "Task"
msgstr "Tarea"
+#. module: hr_planning_resources
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.helpdesk_ticket_edit_view_form
+#: model_terms:ir.ui.view,arch_db:hr_planning_resources.view_project_task_form
+msgid "Tasks"
+msgstr "Tareas"
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/models/hr_task_mixin.py:0
+#, python-format
+msgid "The method _compute_hr_task_count must be implemented in the subclass."
+msgstr "El método _compute_hr_task_count debe implementarse en la subclase."
+
#. module: hr_planning_resources
#. odoo-python
#: code:addons/hr_planning_resources/models/hr_task_recurrency.py:0
@@ -692,6 +699,20 @@ msgstr "Tarea"
msgid "The number of repetitions cannot be negative."
msgstr "El número de repeticiones no puede ser negativo."
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/wizard/create_hr_task.py:0
+#, python-format
+msgid "The record does not exist."
+msgstr "El registro no existe."
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/wizard/create_hr_task.py:0
+#, python-format
+msgid "The selected user does not have an associated employee."
+msgstr "El usuario seleccionado no tiene un empleado asociado."
+
#. module: hr_planning_resources
#. odoo-python
#: code:addons/hr_planning_resources/models/hr_task.py:0
@@ -705,7 +726,7 @@ msgstr "Entrada"
#. module: hr_planning_resources
#: model:ir.model,name:hr_planning_resources.model_hr_leave
msgid "Time Off"
-msgstr "Permiso"
+msgstr "Ausencias"
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__title
@@ -723,6 +744,13 @@ msgstr "Tipo"
msgid "Type of the exception activity on record."
msgstr "Tipo de actividad de excepción registrada."
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/wizard/create_hr_task.py:0
+#, python-format
+msgid "Unsupported resource model: %s"
+msgstr "No se admite el modelo de recurso: %s"
+
#. module: hr_planning_resources
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task__repeat_type__until
#: model:ir.model.fields.selection,name:hr_planning_resources.selection__hr_task_recurrency__repeat_type__until
@@ -746,7 +774,7 @@ msgid "User"
msgstr "Usuario"
#. module: hr_planning_resources
-#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__user_ids
+#: model:ir.model.fields,field_description:hr_planning_resources.field_create_hr_task__user_id
msgid "Users"
msgstr "Usuarios"
@@ -769,8 +797,12 @@ msgstr "Semanas"
#. module: hr_planning_resources
#: model:ir.model.fields,help:hr_planning_resources.field_hr_task__member_of_department
-msgid "Whether the employee is a member of the active user's department or one of it's child department."
-msgstr "Si el empleado es miembro del departamento del usuario activo o uno de sus departamentos secundarios."
+msgid ""
+"Whether the employee is a member of the active user's department or one of "
+"it's child department."
+msgstr ""
+"Si el empleado es miembro del departamento del usuario activo o uno de sus "
+"departamentos secundarios."
#. module: hr_planning_resources
#: model:ir.model.fields,field_description:hr_planning_resources.field_hr_task__working_days_count
@@ -790,14 +822,32 @@ msgstr "Años"
msgid "has requested time off"
msgstr "ha solicitado tiempo libre"
-#. module: hr_planning_resources
-#: model:ir.model,name:hr_planning_resources.model_hr_task_mixin
-msgid "hr.task.mixin"
-msgstr "hr.task.mixin"
-
#. module: hr_planning_resources
#. odoo-python
#: code:addons/hr_planning_resources/models/hr_leave.py:0
#, python-format
msgid "is on time off"
msgstr "está en tiempo libre"
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/models/hr_leave.py:0
+#, python-format
+msgid "{employee} {time_off_type}{period_leaves}. \n"
+msgstr ""
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/models/hr_leave.py:0
+#, python-format
+msgid ""
+"{prefix} from the {dfrom_date} at {dfrom_time} to the {dto_date} at "
+"{dto_time}"
+msgstr "{prefix} desde el {dfrom_date} a las {dfrom_time} hasta el {dto_date} a las {dto_time}"
+
+#. module: hr_planning_resources
+#. odoo-python
+#: code:addons/hr_planning_resources/models/hr_leave.py:0
+#, python-format
+msgid "{prefix} from the {dfrom} to the {dto}"
+msgstr "{prefix} desde el {dfrom} hasta el {dto}"
diff --git a/hr_planning_resources/models/hr_leave.py b/hr_planning_resources/models/hr_leave.py
index 4c203a4..9d9d595 100644
--- a/hr_planning_resources/models/hr_leave.py
+++ b/hr_planning_resources/models/hr_leave.py
@@ -88,7 +88,8 @@ def format_period_leave(period, prefix):
dto = period["to"]
if period.get("show_hours", False):
return _(
- "{prefix} from the {dfrom_date} at {dfrom_time} to the {dto_date} at {dto_time}"
+ "{prefix} from the {dfrom_date} at {dfrom_time} to "
+ "the {dto_date} at {dto_time}"
).format(
prefix=prefix,
dfrom_date=format_date(self.env, localize(dfrom)),
diff --git a/hr_planning_resources/models/hr_task.py b/hr_planning_resources/models/hr_task.py
index 234589f..77f75d6 100644
--- a/hr_planning_resources/models/hr_task.py
+++ b/hr_planning_resources/models/hr_task.py
@@ -37,9 +37,7 @@ def _default_date_end(self):
return datetime.combine(fields.Date.context_today(self), time.max)
def _get_default_employee(self):
- return self.env["hr.employee"].search(
- [("user_id", "=", self.env.uid)], limit=1
- )
+ return self.env["hr.employee"].search([("user_id", "=", self.env.uid)], limit=1)
name = fields.Char(compute="_compute_name", store=True)
title = fields.Char(compute="_compute_title", store=True)
@@ -58,12 +56,8 @@ def _get_default_employee(self):
"hr.department",
related="employee_id.department_id",
)
- employee_parent_id = fields.Many2one(
- related="employee_id.parent_id", store=True
- )
- member_of_department = fields.Boolean(
- related="employee_id.member_of_department"
- )
+ employee_parent_id = fields.Many2one(related="employee_id.parent_id", store=True)
+ member_of_department = fields.Boolean(related="employee_id.member_of_department")
company_id = fields.Many2one(
"res.company",
default=lambda self: self.env.user.company_id.id,
@@ -167,9 +161,7 @@ def _get_default_employee(self):
copy=True,
)
- is_recompute_forced = fields.Boolean(
- default=False, string="Recompute Forced?"
- )
+ is_recompute_forced = fields.Boolean(default=False, string="Recompute Forced?")
@api.onchange("filtered_project_id")
def _onchange_filtered_project_id(self):
@@ -209,12 +201,11 @@ def default_get(self, fields_list):
def _company_task_working_hours(self, start, end):
company = self.company_id or self.env.company
- work_interval = company.resource_calendar_id._work_intervals_batch(
- start, end
- )[False]
+ work_interval = company.resource_calendar_id._work_intervals_batch(start, end)[
+ False
+ ]
intervals = [
- (date_start, date_stop)
- for date_start, date_stop, _ in work_interval
+ (date_start, date_stop) for date_start, date_stop, _ in work_interval
]
date_start, date_end = (start, end)
if intervals:
@@ -222,9 +213,7 @@ def _company_task_working_hours(self, start, end):
# Si las fechas de inicio y fin son el mismo día
date_start = intervals[0][0]
date_end = [
- stop
- for _, stop in intervals
- if stop.date() == date_start.date()
+ stop for _, stop in intervals if stop.date() == date_start.date()
][-1]
else:
# Si las fechas de inicio y fin son diferentes días
@@ -240,9 +229,7 @@ def _calculate_task_duration(self):
max_duration = (
period.days + (1 if period.seconds else 0)
) * self.company_id.resource_calendar_id.hours_per_day
- return (
- min(task_duration, max_duration) if max_duration else task_duration
- )
+ return min(task_duration, max_duration) if max_duration else task_duration
def _get_task_working_hours_over_period(
self, start_utc, end_utc, work_intervals, calendar_intervals
@@ -288,9 +275,7 @@ def _compute_task_allocated_percentage(self):
)
def _compute_task_allocated_hours(self):
# Separate planning tasks from tasks with assigned resources
- planning_tasks = self.filtered(
- lambda s: not s.company_id and not s.resource_id
- )
+ planning_tasks = self.filtered(lambda s: not s.company_id and not s.resource_id)
tasks_with_calendar = self - planning_tasks
# Calculate allocated hours for planning tasks
@@ -303,9 +288,7 @@ def _compute_task_allocated_hours(self):
return # Early return if there are no tasks with calendars.
# Determine the date range for planned tasks with calendars
- start_utc = pytz.utc.localize(
- min(tasks_with_calendar.mapped("date_start"))
- )
+ start_utc = pytz.utc.localize(min(tasks_with_calendar.mapped("date_start")))
end_utc = pytz.utc.localize(max(tasks_with_calendar.mapped("date_end")))
# Get valid working intervals for the resource's calendar
(
@@ -319,9 +302,9 @@ def _compute_task_allocated_hours(self):
for task in tasks_with_calendar:
if task.is_recompute_forced:
- time_delta = pytz.utc.localize(
- task.date_end
- ) - pytz.utc.localize(task.date_start)
+ time_delta = pytz.utc.localize(task.date_end) - pytz.utc.localize(
+ task.date_start
+ )
task.allocated_hours = time_delta.total_seconds() / 3600
else:
# work_days_data = task.employee_id._get_work_days_data_batch(
@@ -353,16 +336,10 @@ def _get_task_duration_over_period(
self.ensure_one()
# Remove timezone info for comparison
- start, stop = start_utc.replace(tzinfo=None), stop_utc.replace(
- tzinfo=None
- )
+ start, stop = start_utc.replace(tzinfo=None), stop_utc.replace(tzinfo=None)
# Return allocated hours if they fall within the start and stop time range
- if (
- has_allocated_hours
- and self.date_start >= start
- and self.date_end <= stop
- ):
+ if has_allocated_hours and self.date_start >= start and self.date_end <= stop:
return self.allocated_hours
# Calculate working hours within the given time frame
@@ -386,9 +363,7 @@ def _compute_task_working_days_count(self):
calendar = task.resource_id.calendar_id
tasks_per_calendar[calendar].add(task.id)
# Update the min and max dates for the corresponding calendar
- datetime_begin, datetime_end = planned_dates_per_calendar_id[
- calendar.id
- ]
+ datetime_begin, datetime_end = planned_dates_per_calendar_id[calendar.id]
planned_dates_per_calendar_id[calendar.id] = (
min(datetime_begin, task.date_start),
max(datetime_end, task.date_end),
@@ -398,9 +373,7 @@ def _compute_task_working_days_count(self):
if not calendar:
tasks.working_days_count = 0
continue
- datetime_begin, datetime_end = planned_dates_per_calendar_id[
- calendar.id
- ]
+ datetime_begin, datetime_end = planned_dates_per_calendar_id[calendar.id]
datetime_begin = timezone_datetime(datetime_begin)
datetime_end = timezone_datetime(datetime_end)
@@ -434,9 +407,7 @@ def _compute_task_duration(self):
if not self.date_start or not self.date_end:
task.duration = 0.0
else:
- task.duration = (
- task.date_end - task.date_start
- ).total_seconds() / 3600
+ task.duration = (task.date_end - task.date_start).total_seconds() / 3600
@api.depends("recurrency_id")
def _compute_repeat(self):
@@ -487,15 +458,11 @@ def _compute_repeat_type(self):
def _inverse_repeat(self):
for task in self:
- if (
- task.repeat and not task.recurrency_id.id
- ): # create the recurrence
+ if task.repeat and not task.recurrency_id.id: # create the recurrence
repeat_until = False
repeat_number = 0
if task.repeat_type == "until":
- repeat_until = fields.Datetime.to_datetime(
- task.repeat_until
- )
+ repeat_until = fields.Datetime.to_datetime(task.repeat_until)
repeat_until = (
repeat_until.replace(
tzinfo=pytz.timezone(
@@ -515,9 +482,7 @@ def _inverse_repeat(self):
"repeat_type": task.repeat_type,
"company_id": task.company_id.id,
}
- recurrence = self.env["hr.task.recurrency"].create(
- recurrency_values
- )
+ recurrence = self.env["hr.task.recurrency"].create(recurrency_values)
task.recurrency_id = recurrence
task.recurrency_id._repeat_task()
elif not task.repeat and task.recurrency_id.id:
@@ -625,9 +590,7 @@ def _add_delta_with_dst(self, start, delta):
tz = pytz.timezone(self._get_tz())
except pytz.UnknownTimeZoneError:
tz = pytz.UTC
- start = (
- start.replace(tzinfo=pytz.utc).astimezone(tz).replace(tzinfo=None)
- )
+ start = start.replace(tzinfo=pytz.utc).astimezone(tz).replace(tzinfo=None)
result = start + delta
return tz.localize(result).astimezone(pytz.utc).replace(tzinfo=None)
@@ -657,16 +620,12 @@ def write(self, values):
for task in self:
if task.recurrency_id and values.get("repeat") is None:
repeat_type = (
- values.get("repeat_type")
- or task.recurrency_id.repeat_type
+ values.get("repeat_type") or task.recurrency_id.repeat_type
)
repeat_until = (
- values.get("repeat_until")
- or task.recurrency_id.repeat_until
- )
- repeat_number = (
- values.get("repeat_number", 0) or task.repeat_number
+ values.get("repeat_until") or task.recurrency_id.repeat_until
)
+ repeat_number = values.get("repeat_number", 0) or task.repeat_number
if repeat_type == "until":
repeat_until = datetime.combine(
fields.Date.to_date(repeat_until),
@@ -675,8 +634,7 @@ def write(self, values):
repeat_until = (
repeat_until.replace(
tzinfo=pytz.timezone(
- task.company_id.resource_calendar_id.tz
- or "UTC"
+ task.company_id.resource_calendar_id.tz or "UTC"
)
)
.astimezone(pytz.utc)
@@ -696,9 +654,9 @@ def write(self, values):
}
task.recurrency_id.write(recurrency_values)
if task.repeat_type == "x_times":
- recurrency_values["repeat_until"] = (
- task.recurrency_id._get_recurrence_last_datetime()
- )
+ recurrency_values[
+ "repeat_until"
+ ] = task.recurrency_id._get_recurrence_last_datetime()
date_end = (
task.date_end
if values.get("repeat_unit")
diff --git a/hr_planning_resources/readme/DESCRIPTION.rst b/hr_planning_resources/readme/DESCRIPTION.rst
index e69de29..76f9d08 100644
--- a/hr_planning_resources/readme/DESCRIPTION.rst
+++ b/hr_planning_resources/readme/DESCRIPTION.rst
@@ -0,0 +1,3 @@
+This module is designed to improve human resources planning and management within an organization.
+It's provides advanced tools for task scheduling, permission management, and resource planning,
+allowing managers and employees to organize and visualize their schedules efficiently.
diff --git a/hr_planning_resources/readme/USAGE.rst b/hr_planning_resources/readme/USAGE.rst
index e69de29..7dea8a2 100644
--- a/hr_planning_resources/readme/USAGE.rst
+++ b/hr_planning_resources/readme/USAGE.rst
@@ -0,0 +1,5 @@
+1. Navigate to the "Planning" section in the main menu.
+2. Select "My Planning" to view your assigned tasks.
+3. To assign a new task, select "My Planning", click on the New button.
+4. You can assign it from the same task, ticket or project using the assign to planning button.
+5. In the task, if the "Force recalculation" checkbox is checked, all hours that have elapsed will be calculated.
diff --git a/hr_planning_resources/static/description/index.html b/hr_planning_resources/static/description/index.html
index e1dc293..74981d6 100644
--- a/hr_planning_resources/static/description/index.html
+++ b/hr_planning_resources/static/description/index.html
@@ -370,20 +370,34 @@ HR Resource Planner
!! source digest: sha256:f8c267bf44bdd476c5d1521e536405cf86ddbed1c66d84d65fd1df159b50805d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
This module is designed to improve human resources planning and management within an organization. +It’s provides advanced tools for task scheduling, permission management, and resource planning, +allowing managers and employees to organize and visualize their schedules efficiently.
Table of contents
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -391,15 +405,15 @@
Do not contact contributors directly about support or help with technical issues.
This module is maintained by the OCA.