From c36b0f3b9d03263a46d86297fd5fee8098b338b9 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 17 Nov 2018 18:20:28 +0100 Subject: [PATCH 01/39] [ADD] project_hr: Link HR with project Project HR ========== This is a technical module for adding some HR information to projects and provide technical fields with HR information: - Employee categories at project and task level. - Employee linked to the user assigned to a task. - Employee categories at user level. These fields can be used later for extra features like task scheduling or security restrictions. It also provides some facilities on project management: * Limit selection of assigned users according selected employee category at task level. * Limit selection of employee categories at task level depending on the selected categories at project level. All are shown if no categories at project level. Configuration ============= For setting employee categories at project level: 1. Go to *Project > Dashboard*. 2. Click on the 3 vertical dots for unfolding options and select "Settings". 3. Put the wanted employee categories on the field "Employee Categories". For setting employee categories: 1. Go to *Project > Search > Tasks*. 2. Select or create a new task. 3. Put the wanted employee categories on the field "Employee categories". 4. If there's already some employee categories selected at project level, those will be the only selectable ones in the task. Usage ===== 1. Go to *Project > Search > Tasks*. 2. If there's an employee category selected in the task, you will only be able to select those users whose employee belongs to that category. Known issues / Roadmap ====================== * Limit project and task visibility according employee categories through overriding security methods (as through record rules is not possible without modifying existing ones). --- project_hr/README.rst | 123 ++++++ project_hr/__init__.py | 3 + project_hr/__manifest__.py | 23 + project_hr/i18n/es.po | 94 +++++ project_hr/i18n/project_hr.pot | 93 ++++ project_hr/models/__init__.py | 5 + project_hr/models/project_project.py | 15 + project_hr/models/project_task.py | 91 ++++ project_hr/models/res_users.py | 23 + project_hr/readme/CONFIGURE.rst | 13 + project_hr/readme/DESCRIPTION.rst | 17 + project_hr/readme/ROADMAP.rst | 3 + project_hr/readme/USAGE.rst | 3 + project_hr/static/description/icon.png | Bin 0 -> 9455 bytes project_hr/static/description/index.html | 466 +++++++++++++++++++++ project_hr/tests/__init__.py | 1 + project_hr/tests/test_project_hr.py | 77 ++++ project_hr/views/project_project_views.xml | 18 + project_hr/views/project_task_views.xml | 23 + 19 files changed, 1091 insertions(+) create mode 100644 project_hr/README.rst create mode 100644 project_hr/__init__.py create mode 100644 project_hr/__manifest__.py create mode 100644 project_hr/i18n/es.po create mode 100644 project_hr/i18n/project_hr.pot create mode 100644 project_hr/models/__init__.py create mode 100644 project_hr/models/project_project.py create mode 100644 project_hr/models/project_task.py create mode 100644 project_hr/models/res_users.py create mode 100644 project_hr/readme/CONFIGURE.rst create mode 100644 project_hr/readme/DESCRIPTION.rst create mode 100644 project_hr/readme/ROADMAP.rst create mode 100644 project_hr/readme/USAGE.rst create mode 100644 project_hr/static/description/icon.png create mode 100644 project_hr/static/description/index.html create mode 100644 project_hr/tests/__init__.py create mode 100644 project_hr/tests/test_project_hr.py create mode 100644 project_hr/views/project_project_views.xml create mode 100644 project_hr/views/project_task_views.xml diff --git a/project_hr/README.rst b/project_hr/README.rst new file mode 100644 index 0000000000..e6d03f6fd2 --- /dev/null +++ b/project_hr/README.rst @@ -0,0 +1,123 @@ +========== +Project HR +========== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github + :target: https://github.com/OCA/project/tree/11.0/project_hr + :alt: OCA/project +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/project-11-0/project-11-0-project_hr + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/140/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This is a technical module for adding some HR information to projects and +provide technical fields with HR information: + +- Employee categories at project and task level. +- Employee linked to the user assigned to a task. +- Employee categories at user level. + +These fields can be used later for extra features like task scheduling or +security restrictions. + +It also provides some facilities on project management: + +* Limit selection of assigned users according selected employee category at + task level. +* Limit selection of employee categories at task level depending on the + selected categories at project level. All are shown if no categories at + project level. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +For setting employee categories at project level: + +#. Go to *Project > Dashboard*. +#. Click on the 3 vertical dots for unfolding options and select "Settings". +#. Put the wanted employee categories on the field "Employee Categories". + +For setting employee categories: + +#. Go to *Project > Search > Tasks*. +#. Select or create a new task. +#. Put the wanted employee categories on the field "Employee categories". +#. If there's already some employee categories selected at project level, those + will be the only selectable ones in the task. + +Usage +===== + +#. Go to *Project > Search > Tasks*. +#. If there's an employee category selected in the task, you will only be able + to select those users whose employee belongs to that category. + +Known issues / Roadmap +====================== + +* Limit project and task visibility according employee categories through + overriding security methods (as through record rules is not possible without + modifying existing ones). + +Bug Tracker +=========== + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px + :target: https://github.com/pedrobaeza + :alt: pedrobaeza + +Current `maintainer `__: + +|maintainer-pedrobaeza| + +This module is part of the `OCA/project `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_hr/__init__.py b/project_hr/__init__.py new file mode 100644 index 0000000000..69f7babdfb --- /dev/null +++ b/project_hr/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/project_hr/__manifest__.py b/project_hr/__manifest__.py new file mode 100644 index 0000000000..f2ff7deb50 --- /dev/null +++ b/project_hr/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Project HR', + 'summary': "Link HR with project", + 'development_status': 'Production/Stable', + 'version': '11.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Tecnativa,Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/project', + 'depends': [ + 'project', + 'hr', + ], + 'data': [ + 'views/project_task_views.xml', + 'views/project_project_views.xml', + ], + 'maintainers': [ + 'pedrobaeza', + ], +} diff --git a/project_hr/i18n/es.po b/project_hr/i18n/es.po new file mode 100644 index 0000000000..767723b2ed --- /dev/null +++ b/project_hr/i18n/es.po @@ -0,0 +1,94 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-17 16:50+0000\n" +"PO-Revision-Date: 2018-11-17 16:50+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" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Categorías RRHH permitidas" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_user_ids +msgid "Allowed users" +msgstr "Usuarios permitidos" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_project_hr_category_ids +#: model:ir.model.fields,field_description:project_hr.field_project_task_hr_category_ids +msgid "Employee Categories" +msgstr "Categorías de empleado" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_project_hr_category_ids +msgid "Here you can link the project to several employee categories, that will be the allowed in tasks." +msgstr "Aquí puede enlazar el proyecto a varias categorías de empleado, que serán las permitidas en las tareas." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_hr_category_id +msgid "Here you can select the employee category suitable to perform this task, limiting the selectable users to be assigned to those that belongs to that category."" +msgstr "Aquí puede seleccionar la categoría de empleado adecuada para realizar esta tarea, limitando los usuarios seleccionables para ser asignados a aquellos que pertenezcan a la categoría." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users_hr_category_ids +msgid "HR categories" +msgstr "Categorías RRHH" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_employee_id +msgid "Linked employee" +msgstr "Empleado relacionado" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Proyecto" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Tarea" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_hr_category_ids +msgid "Technical field for computing allowed employee categories according categories at project level." +msgstr "Campo técnico para calcular las categorías de empleado permitidos conforme las categorías a nivel de proyecto." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_user_ids +msgid "Technical field for computing allowed users according employee category." +msgstr "Campo técnico para calcular los usuarios permitidos conforme a la categoría de empleado." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_res_users_hr_category_ids +msgid "Technical field for computing dynamically employee categories linked to the user in the current company." +msgstr "Campo técnico para calcular dinámicamente las categorías de empleado enlazadas con el usuario en la compañía actual." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "Users" +msgstr "Usuarios" + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:82 +#, python-format +msgid "You can't assign a category that is not allowed at project level." +msgstr "No puede asignar una categoría que no está permitida a nivel de proyecto." + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:71 +#, python-format +msgid "You can't assign a user not belonging to the selected employee category." +msgstr "No puede asignar un usuario que no pertenezca a la categoría de empleado seleccionada." diff --git a/project_hr/i18n/project_hr.pot b/project_hr/i18n/project_hr.pot new file mode 100644 index 0000000000..e93c801423 --- /dev/null +++ b/project_hr/i18n/project_hr.pot @@ -0,0 +1,93 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \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" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_user_ids +msgid "Allowed users" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_project_hr_category_ids +#: model:ir.model.fields,field_description:project_hr.field_project_task_hr_category_ids +msgid "Employee Categories" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users_hr_category_ids +msgid "HR categories" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_project_hr_category_ids +msgid "Here you can link the project to several employee categories, that will be the allowed in tasks." +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_hr_category_ids +msgid "Here you can select the employee category suitable to perform this task, limiting the selectable users to be assigned to those that belongs to that category." +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_employee_id +msgid "Linked employee" +msgstr "" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_hr_category_ids +msgid "Technical field for computing allowed employee categories according categories at project level." +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_user_ids +msgid "Technical field for computing allowed users according employee category." +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_res_users_hr_category_ids +msgid "Technical field for computing dynamically employee categories linked to the user in the current company." +msgstr "" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "Users" +msgstr "" + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:89 +#, python-format +msgid "You can't assign a category that is not allowed at project level." +msgstr "" + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:78 +#, python-format +msgid "You can't assign a user not belonging to the selected employee category." +msgstr "" + diff --git a/project_hr/models/__init__.py b/project_hr/models/__init__.py new file mode 100644 index 0000000000..2000ba0fff --- /dev/null +++ b/project_hr/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import project_project +from . import project_task +from . import res_users diff --git a/project_hr/models/project_project.py b/project_hr/models/project_project.py new file mode 100644 index 0000000000..74ec3ff738 --- /dev/null +++ b/project_hr/models/project_project.py @@ -0,0 +1,15 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProjectProject(models.Model): + _inherit = 'project.project' + + hr_category_ids = fields.Many2many( + comodel_name='hr.employee.category', + string="Employee Categories", + help="Here you can link the project to several employee categories, " + "that will be the allowed in tasks.", + ) diff --git a/project_hr/models/project_task.py b/project_hr/models/project_task.py new file mode 100644 index 0000000000..5b53604d61 --- /dev/null +++ b/project_hr/models/project_task.py @@ -0,0 +1,91 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, api, exceptions, fields, models + + +class ProjectTask(models.Model): + _inherit = 'project.task' + + employee_id = fields.Many2one( + comodel_name="hr.employee", + string="Linked employee", + compute="_compute_employee_id", + store=True, + ) + hr_category_ids = fields.Many2many( + comodel_name="hr.employee.category", + string="Employee Categories", + domain="[('id', 'in', allowed_hr_category_ids)]", + help="Here you can select the employee category suitable to perform " + "this task, limiting the selectable users to be assigned to " + "those that belongs to that category.", + ) + user_id = fields.Many2one( + domain="[('id', 'in', allowed_user_ids)]", + ) + allowed_hr_category_ids = fields.Many2many( + comodel_name="hr.employee.category", + string="Allowed HR categories", + compute="_compute_allowed_hr_category_ids", + help="Technical field for computing allowed employee categories " + "according categories at project level.", + ) + allowed_user_ids = fields.Many2many( + comodel_name="res.users", + string="Allowed users", + compute="_compute_allowed_user_ids", + help="Technical field for computing allowed users according employee " + "category.", + ) + + @api.depends('user_id', 'company_id') + def _compute_employee_id(self): + for task in self.filtered('user_id'): + task.employee_id = task.user_id.employee_ids.filtered( + lambda x: x.company_id == task.company_id + )[:1] + + @api.depends('project_id', 'project_id.hr_category_ids') + def _compute_allowed_hr_category_ids(self): + hr_category_obj = self.env['hr.employee.category'] + for task in self: + if task.project_id.hr_category_ids: + task.allowed_hr_category_ids = task.project_id.hr_category_ids + else: + task.allowed_hr_category_ids = hr_category_obj.search([]) + + @api.depends('hr_category_ids', 'company_id') + def _compute_allowed_user_ids(self): + user_obj = self.env['res.users'] + for task in self: + domain = [] + if task.hr_category_ids: + domain = [ + ('employee_ids.company_id', '=', task.company_id.id), + ('employee_ids.category_ids', 'in', + task.hr_category_ids.ids), + ] + task.allowed_user_ids = user_obj.search(domain) + + @api.constrains('hr_category_ids', 'user_id') + def _check_employee_category_user(self): + """Check user's employee belong to the selected category.""" + for task in self.filtered(lambda x: x.hr_category_ids and x.user_id): + if (any(x not in task.employee_id.category_ids + for x in task.hr_category_ids)): + raise exceptions.ValidationError( + _("You can't assign a user not belonging to the selected " + "employee category."), + ) + + @api.constrains('hr_category_ids', 'project_id') + def _check_employee_category_project(self): + for task in self.filtered('hr_category_ids'): + if (task.project_id.hr_category_ids and + bool(task.hr_category_ids - + task.project_id.hr_category_ids)): + raise exceptions.ValidationError( + _("You can't assign a category that is not allowed at " + "project level."), + ) diff --git a/project_hr/models/res_users.py b/project_hr/models/res_users.py new file mode 100644 index 0000000000..2ff3d59c11 --- /dev/null +++ b/project_hr/models/res_users.py @@ -0,0 +1,23 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ResUsers(models.Model): + _inherit = 'res.users' + + hr_category_ids = fields.Many2many( + comodel_name="hr.employee.category", + string="HR categories", + compute="_compute_hr_category_ids", + help="Technical field for computing dynamically employee categories " + "linked to the user in the current company." + ) + + @api.depends('company_id', 'employee_ids', 'employee_ids.category_ids') + def _compute_hr_category_ids(self): + for user in self: + user.hr_category_ids = user.employee_ids.filtered( + lambda x: x.company_id == user.company_id + )[:1].category_ids diff --git a/project_hr/readme/CONFIGURE.rst b/project_hr/readme/CONFIGURE.rst new file mode 100644 index 0000000000..9aaf8e9743 --- /dev/null +++ b/project_hr/readme/CONFIGURE.rst @@ -0,0 +1,13 @@ +For setting employee categories at project level: + +#. Go to *Project > Dashboard*. +#. Click on the 3 vertical dots for unfolding options and select "Settings". +#. Put the wanted employee categories on the field "Employee Categories". + +For setting employee categories: + +#. Go to *Project > Search > Tasks*. +#. Select or create a new task. +#. Put the wanted employee categories on the field "Employee categories". +#. If there's already some employee categories selected at project level, those + will be the only selectable ones in the task. diff --git a/project_hr/readme/DESCRIPTION.rst b/project_hr/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..a39167e4e2 --- /dev/null +++ b/project_hr/readme/DESCRIPTION.rst @@ -0,0 +1,17 @@ +This is a technical module for adding some HR information to projects and +provide technical fields with HR information: + +- Employee categories at project and task level. +- Employee linked to the user assigned to a task. +- Employee categories at user level. + +These fields can be used later for extra features like task scheduling or +security restrictions. + +It also provides some facilities on project management: + +* Limit selection of assigned users according selected employee category at + task level. +* Limit selection of employee categories at task level depending on the + selected categories at project level. All are shown if no categories at + project level. diff --git a/project_hr/readme/ROADMAP.rst b/project_hr/readme/ROADMAP.rst new file mode 100644 index 0000000000..321da2d915 --- /dev/null +++ b/project_hr/readme/ROADMAP.rst @@ -0,0 +1,3 @@ +* Limit project and task visibility according employee categories through + overriding security methods (as through record rules is not possible without + modifying existing ones). diff --git a/project_hr/readme/USAGE.rst b/project_hr/readme/USAGE.rst new file mode 100644 index 0000000000..03e7d0bbba --- /dev/null +++ b/project_hr/readme/USAGE.rst @@ -0,0 +1,3 @@ +#. Go to *Project > Search > Tasks*. +#. If there's an employee category selected in the task, you will only be able + to select those users whose employee belongs to that category. diff --git a/project_hr/static/description/icon.png b/project_hr/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC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fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html new file mode 100644 index 0000000000..cd8821e45a --- /dev/null +++ b/project_hr/static/description/index.html @@ -0,0 +1,466 @@ + + + + + + +Project HR + + + +
+

Project HR

+ + +

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runbot

+

This is a technical module for adding some HR information to projects and +provide technical fields with HR information:

+
    +
  • Employee categories at project and task level.
  • +
  • Employee linked to the user assigned to a task.
  • +
  • Employee categories at user level.
  • +
+

These fields can be used later for extra features like task scheduling or +security restrictions.

+

It also provides some facilities on project management:

+
    +
  • Limit selection of assigned users according selected employee category at +task level.
  • +
  • Limit selection of employee categories at task level depending on the +selected categories at project level. All are shown if no categories at +project level.
  • +
+

Table of contents

+ +
+

Configuration

+

For setting employee categories at project level:

+
    +
  1. Go to Project > Dashboard.
  2. +
  3. Click on the 3 vertical dots for unfolding options and select “Settings”.
  4. +
  5. Put the wanted employee categories on the field “Employee Categories”.
  6. +
+

For setting employee categories:

+
    +
  1. Go to Project > Search > Tasks.
  2. +
  3. Select or create a new task.
  4. +
  5. Put the wanted employee categories on the field “Employee categories”.
  6. +
  7. If there’s already some employee categories selected at project level, those +will be the only selectable ones in the task.
  8. +
+
+
+

Usage

+
    +
  1. Go to Project > Search > Tasks.
  2. +
  3. If there’s an employee category selected in the task, you will only be able +to select those users whose employee belongs to that category.
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Limit project and task visibility according employee categories through +overriding security methods (as through record rules is not possible without +modifying existing ones).
  • +
+
+
+

Bug Tracker

+

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 smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

pedrobaeza

+

This module is part of the OCA/project project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/project_hr/tests/__init__.py b/project_hr/tests/__init__.py new file mode 100644 index 0000000000..7b64f44fe7 --- /dev/null +++ b/project_hr/tests/__init__.py @@ -0,0 +1 @@ +from . import test_project_hr diff --git a/project_hr/tests/test_project_hr.py b/project_hr/tests/test_project_hr.py new file mode 100644 index 0000000000..26b957bd85 --- /dev/null +++ b/project_hr/tests/test_project_hr.py @@ -0,0 +1,77 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import SavepointCase +from odoo.exceptions import ValidationError + + +class TestProjectHr(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.user_model = cls.env['res.users'] + cls.user = cls.user_model.create({ + 'login': 'test_project_hr', + 'name': 'Test user', + }) + cls.user_2 = cls.user_model.create({ + 'login': 'test_project_hr_2', + 'name': 'Test user 2', + }) + cls.hr_category = cls.env['hr.employee.category'].create({ + 'name': 'Test employee category', + }) + cls.hr_category_2 = cls.env['hr.employee.category'].create({ + 'name': 'Test employee category 2', + }) + cls.employee = cls.env['hr.employee'].create({ + 'name': 'Test employee', + 'user_id': cls.user.id, + 'category_ids': [(6, 0, cls.hr_category.ids)], + }) + cls.project = cls.env['project.project'].create({ + 'name': 'Test project', + 'hr_category_ids': [(4, cls.hr_category.id)] + }) + cls.task = cls.env['project.task'].create({ + 'name': 'Test task', + 'project_id': cls.project.id, + 'hr_category_ids': [(4, cls.hr_category.id)], + 'user_id': cls.user.id, + }) + + def test_user(self): + self.assertEqual(self.user.hr_category_ids, self.hr_category) + self.employee.category_ids = [(4, self.hr_category_2.id)] + self.assertEqual( + self.user.hr_category_ids, self.hr_category + self.hr_category_2, + ) + + def test_task(self): + self.assertEqual(self.task.employee_id, self.employee) + self.assertEqual(self.task.allowed_hr_category_ids, self.hr_category) + self.project.hr_category_ids = [(4, self.hr_category_2.id)] + self.assertEqual(self.task.allowed_hr_category_ids, + self.hr_category + self.hr_category_2) + self.assertEqual(self.task.allowed_user_ids, self.user) + self.env['hr.employee'].create({ + 'name': 'Test employee 2', + 'user_id': self.user_2.id, + 'category_ids': [(6, 0, self.hr_category.ids)], + }) + self.assertEqual(self.task.allowed_user_ids, self.user + self.user_2) + # Test _check_employee_category_user constraint + with self.assertRaises(ValidationError): + self.task.hr_category_ids = [(4, self.hr_category_2.id)] + with self.assertRaises(ValidationError): + self.task.user_id = self.user_2.id + # Test _check_employee_category_project constraint + self.project.hr_category_ids = [(4, self.hr_category_2.id)] + with self.assertRaises(ValidationError): + self.task.hr_category_ids = [(4, self.hr_category_2.id)] + + def test_task_project_wo_categories(self): + self.project.hr_category_ids = False + self.assertTrue(self.task.allowed_hr_category_ids) + # This operation shouldn't give error + self.task.hr_category_ids = [(4, self.hr_category.id)] diff --git a/project_hr/views/project_project_views.xml b/project_hr/views/project_project_views.xml new file mode 100644 index 0000000000..9ae428c37c --- /dev/null +++ b/project_hr/views/project_project_views.xml @@ -0,0 +1,18 @@ + + + + + + + Project form: Add employee categories + project.project + + + + + + + + + diff --git a/project_hr/views/project_task_views.xml b/project_hr/views/project_task_views.xml new file mode 100644 index 0000000000..d76265f412 --- /dev/null +++ b/project_hr/views/project_task_views.xml @@ -0,0 +1,23 @@ + + + + + + + Project task form: Add linked employee and Employee category + project.task + + + + + + + + + + + + + + From 12dd6d9daba3f27653ea319f040d1443d9d94336 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Fri, 12 Jul 2019 13:16:33 +0000 Subject: [PATCH 02/39] Added translation using Weblate (German) --- project_hr/i18n/de.po | 109 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 project_hr/i18n/de.po diff --git a/project_hr/i18n/de.po b/project_hr/i18n/de.po new file mode 100644 index 0000000000..a8c76f6934 --- /dev/null +++ b/project_hr/i18n/de.po @@ -0,0 +1,109 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-12 15:43+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Erlaubte HR Kategorien" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_user_ids +msgid "Allowed users" +msgstr "Erlaubte Benutzer" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_project_hr_category_ids +#: model:ir.model.fields,field_description:project_hr.field_project_task_hr_category_ids +msgid "Employee Categories" +msgstr "Mitarbeiter-Kategorien" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users_hr_category_ids +msgid "HR categories" +msgstr "HR Kategorien" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_project_hr_category_ids +msgid "Here you can link the project to several employee categories, that will be the allowed in tasks." +msgstr "" +"Einem Projekt können mehrere Mitarbeiter-Kategorien zugewiesen werden. Nur " +"diese können in Aufgaben ausgewählt werden." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_hr_category_ids +msgid "Here you can select the employee category suitable to perform this task, limiting the selectable users to be assigned to those that belongs to that category." +msgstr "" +"Einer Aufgabe kann eine Mitarbeiter-Kategorie zugewiesen werden. Aufgaben " +"dürfen dann nur Mitarbeitern dieser Kategorie zugewiesen werden." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_employee_id +msgid "Linked employee" +msgstr "Zugehöriger Mitarbeiter" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Projekt" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Aufgabe" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_hr_category_ids +msgid "Technical field for computing allowed employee categories according categories at project level." +msgstr "" +"Dies ist ein technisch benötigtes Feld zur Berechnung der erlaubten " +"Mitarbeiter-Kategorien, die auf Projektebene festgelegt wurden." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_user_ids +msgid "Technical field for computing allowed users according employee category." +msgstr "" +"Dies ist ein technisch benötigtes Feld zur Berechnung der erlaubten " +"Mitarbeiter, die zur Mitarbeiter-Kategorie gehören." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_res_users_hr_category_ids +msgid "Technical field for computing dynamically employee categories linked to the user in the current company." +msgstr "" +"Dies ist ein technisch benötigtes Feld zur dynamischen Berechnung der " +"Mitarbeiter-Kategorien, die zum Benutzer des aktuellen Unternehmens gehören." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "Users" +msgstr "Benutzer" + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:89 +#, python-format +msgid "You can't assign a category that is not allowed at project level." +msgstr "" +"Es darf keine Kategorie zu der Aufgabe hinzugefügt werden, die auf " +"Projektebene nicht erlaubt wurde." + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:78 +#, python-format +msgid "You can't assign a user not belonging to the selected employee category." +msgstr "" +"Der Aufgabe darf kein Benutzer zugewiesen werden, der nicht zur gewählten " +"Mitarbeiter-Kategorie gehört." From 9aad7deda4c9d1bc03501390ff49fea6a6668f62 Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 23 Jul 2019 09:00:25 +0000 Subject: [PATCH 03/39] Added translation using Weblate (Slovenian) --- project_hr/i18n/sl.po | 108 +++++++++++++++++++++++ project_hr/static/description/index.html | 2 +- 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 project_hr/i18n/sl.po diff --git a/project_hr/i18n/sl.po b/project_hr/i18n/sl.po new file mode 100644 index 0000000000..e2bc9e7e58 --- /dev/null +++ b/project_hr/i18n/sl.po @@ -0,0 +1,108 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-24 18:43+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Dovoljene kategorije kadrov" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_allowed_user_ids +msgid "Allowed users" +msgstr "Dovoljeni uporabniki" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_project_hr_category_ids +#: model:ir.model.fields,field_description:project_hr.field_project_task_hr_category_ids +msgid "Employee Categories" +msgstr "Kategorije zaposlenih" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users_hr_category_ids +msgid "HR categories" +msgstr "Kadrovske kategorije" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_project_hr_category_ids +msgid "Here you can link the project to several employee categories, that will be the allowed in tasks." +msgstr "" +"Tu lahko povežete projekt z več kategorijami kadrov, ki bodo dovoljeni v " +"opravilih." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_hr_category_ids +msgid "Here you can select the employee category suitable to perform this task, limiting the selectable users to be assigned to those that belongs to that category." +msgstr "" +"Tu lahko izberete kategorijo kadrov primerno za opravljanje tega opravila in " +"tako omejite izbor uporabnikov, ki se jim lahko opravilo dodeli na to " +"kategorijo." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task_employee_id +msgid "Linked employee" +msgstr "Povezani kader" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Projekt" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Opravilo" + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_hr_category_ids +msgid "Technical field for computing allowed employee categories according categories at project level." +msgstr "" +"Tehnično polje za obdelavo dovoljenih kadrovskih kategorij glede na " +"kategorije na projektnem nivoju." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task_allowed_user_ids +msgid "Technical field for computing allowed users according employee category." +msgstr "" +"Tehnično polje za obdelavo dovoljenih uporabnikov glede na kadrovsko " +"kategorijo." + +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_res_users_hr_category_ids +msgid "Technical field for computing dynamically employee categories linked to the user in the current company." +msgstr "" +"Tehnično polje za dinamično obdelavo kategorij kadrov povezanih z " +"uporabnikom in trenutno družbo." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "Users" +msgstr "Uporabniki" + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:89 +#, python-format +msgid "You can't assign a category that is not allowed at project level." +msgstr "Kategorije, ki ni dovoljena na projektnem nivoju, ne morete dodeliti." + +#. module: project_hr +#: code:addons/project_hr/models/project_task.py:78 +#, python-format +msgid "You can't assign a user not belonging to the selected employee category." +msgstr "" +"Ne morete dodeliti uporabnika, ki ne spada v izbrano kadrovsko kategorijo." diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index cd8821e45a..4cf6d1afda 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -3,7 +3,7 @@ - + Project HR -
-

Project HR

+
+ + +Odoo Community Association + +
+

Project HR

-

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects and provide technical fields with HR information:

    @@ -381,8 +386,8 @@

    Project HR

    or security restrictions.

    It also provides some facilities on project management:

      -
    • Limit selection of assigned users according selected employee -category at task level.
    • +
    • Limit selection of assigned users according selected employee category +at task level.
    • Limit selection of employee categories at task level depending on the selected categories at project level. All are shown if no categories at project level.
    • @@ -403,7 +408,7 @@

      Project HR

-

Configuration

+

Configuration

For setting employee categories at project level:

  1. Go to Project > Projects.
  2. @@ -423,7 +428,7 @@

    Configuration

-

Usage

+

Usage

  1. Go to Project > Search > Tasks.
  2. If there’s an employee category selected in the task, you will only @@ -432,7 +437,7 @@

    Usage

-

Known issues / Roadmap

+

Known issues / Roadmap

  • Limit project and task visibility according employee categories through overriding security methods (as through record rules is not @@ -440,7 +445,7 @@

    Known issues / Roadmap

-

Bug Tracker

+

Bug Tracker

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 @@ -448,15 +453,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -489,5 +494,6 @@

Maintainers

+
From 306c0164ece0bf9c20c3d408546fb47a247e2e95 Mon Sep 17 00:00:00 2001 From: Abraham Anes Date: Mon, 16 Jun 2025 12:49:31 +0200 Subject: [PATCH 31/39] [17.0][IMP] project_hr: restore odoo default user_ids domain [BOT] post-merge updates --- project_hr/README.rst | 2 +- project_hr/__manifest__.py | 2 +- project_hr/models/project_task.py | 2 +- project_hr/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project_hr/README.rst b/project_hr/README.rst index ec47fa7a77..18bf663337 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -11,7 +11,7 @@ Project HR !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:554e1d5dfee7861dc39af17c22d44867a92508ae9ff98452bc8bed256389b560 + !! source digest: sha256:4e0d5c3e65e96a955c9316312be5178a728fe349f00b5843fb881a5be464af9f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/project_hr/__manifest__.py b/project_hr/__manifest__.py index 5fdc9238e3..35a62aa814 100644 --- a/project_hr/__manifest__.py +++ b/project_hr/__manifest__.py @@ -5,7 +5,7 @@ "name": "Project HR", "summary": "Link HR with project", "development_status": "Production/Stable", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/project", diff --git a/project_hr/models/project_task.py b/project_hr/models/project_task.py index 92a5aebf71..d6e75c2f1c 100644 --- a/project_hr/models/project_task.py +++ b/project_hr/models/project_task.py @@ -60,7 +60,7 @@ def _compute_allowed_hr_category_ids(self): def _compute_allowed_assigned_user_ids(self): user_obj = self.env["res.users"] for task in self: - domain = [] + domain = [("share", "=", False), ("active", "=", True)] if task.hr_category_ids: domain = [ ( diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index 9708245596..430fb46a79 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -372,7 +372,7 @@

Project HR

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:554e1d5dfee7861dc39af17c22d44867a92508ae9ff98452bc8bed256389b560 +!! source digest: sha256:4e0d5c3e65e96a955c9316312be5178a728fe349f00b5843fb881a5be464af9f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects From 26b492b4f23acbee67f3e47feb315c08981030c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 2 Sep 2025 11:01:53 +0200 Subject: [PATCH 32/39] [MIG] project_hr: Migration to 18.0 TT57843 --- project_hr/README.rst | 56 +++++++++++----------- project_hr/__manifest__.py | 2 +- project_hr/i18n/ca.po | 6 --- project_hr/i18n/de.po | 6 --- project_hr/i18n/es.po | 6 --- project_hr/i18n/it.po | 15 ------ project_hr/i18n/sl.po | 6 --- project_hr/models/project_task.py | 41 ++++++---------- project_hr/static/description/index.html | 38 +++++++-------- project_hr/tests/test_project_hr.py | 59 ++++++++++++++---------- project_hr/views/project_task_views.xml | 41 ++++++++-------- 11 files changed, 113 insertions(+), 163 deletions(-) diff --git a/project_hr/README.rst b/project_hr/README.rst index 18bf663337..4d2a5a0a5e 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ========== Project HR ========== @@ -17,17 +13,17 @@ Project HR .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github - :target: https://github.com/OCA/project/tree/17.0/project_hr + :target: https://github.com/OCA/project/tree/18.0/project_hr :alt: OCA/project .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_hr + :target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_hr :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -35,20 +31,20 @@ Project HR This is a technical module for adding some HR information to projects and provide technical fields with HR information: -- Employee categories at project and task level. -- Employee linked to the user assigned to a task. -- Employee categories at user level. +- Employee categories at project and task level. +- Employee linked to the user assigned to a task. +- Employee categories at user level. These fields can be used later for extra features like task scheduling or security restrictions. It also provides some facilities on project management: -- Limit selection of assigned users according selected employee category - at task level. -- Limit selection of employee categories at task level depending on the - selected categories at project level. All are shown if no categories - at project level. +- Limit selection of assigned users according selected employee + category at task level. +- Limit selection of employee categories at task level depending on the + selected categories at project level. All are shown if no categories + at project level. **Table of contents** @@ -86,9 +82,9 @@ Usage Known issues / Roadmap ====================== -- Limit project and task visibility according employee categories - through overriding security methods (as through record rules is not - possible without modifying existing ones). +- Limit project and task visibility according employee categories + through overriding security methods (as through record rules is not + possible without modifying existing ones). Bug Tracker =========== @@ -96,7 +92,7 @@ Bug Tracker 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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -111,19 +107,19 @@ Authors Contributors ------------ -- `Tecnativa `__: +- `Tecnativa `__: - - Pedro M. Baeza - - Victor M.M. Torres - - Ernesto Tejeda - - Pilar Vargas + - Pedro M. Baeza + - Victor M.M. Torres + - Ernesto Tejeda + - Pilar Vargas -- `CorporateHub `__ +- `CorporateHub `__ - - Alexey Pelykh + - Alexey Pelykh -- Alfadil Tabar -- Abraham Anes +- Alfadil Tabar +- Abraham Anes Maintainers ----------- @@ -146,6 +142,6 @@ Current `maintainer `__: |maintainer-pedrobaeza| -This module is part of the `OCA/project `_ project on GitHub. +This module is part of the `OCA/project `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_hr/__manifest__.py b/project_hr/__manifest__.py index 35a62aa814..2e5fff351e 100644 --- a/project_hr/__manifest__.py +++ b/project_hr/__manifest__.py @@ -5,7 +5,7 @@ "name": "Project HR", "summary": "Link HR with project", "development_status": "Production/Stable", - "version": "17.0.1.0.1", + "version": "18.0.1.0.0", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/project", diff --git a/project_hr/i18n/ca.po b/project_hr/i18n/ca.po index 56be6d8e44..5607d4adf9 100644 --- a/project_hr/i18n/ca.po +++ b/project_hr/i18n/ca.po @@ -125,9 +125,3 @@ msgid "" msgstr "" "No pot assignar un/a usuari/ària que no pertany a la categoria d'empleat/ada " "seleccionada." - -#~ msgid "Linked employee" -#~ msgstr "Empleat/da relacionat/da" - -#~ msgid "Users" -#~ msgstr "Usuaris/àries" diff --git a/project_hr/i18n/de.po b/project_hr/i18n/de.po index dc6373cde8..12a4ac6754 100644 --- a/project_hr/i18n/de.po +++ b/project_hr/i18n/de.po @@ -125,9 +125,3 @@ msgid "" msgstr "" "Der Aufgabe darf kein Benutzer zugewiesen werden, der nicht zur gewählten " "Mitarbeiter-Kategorie gehört." - -#~ msgid "Linked employee" -#~ msgstr "Zugehöriger Mitarbeiter" - -#~ msgid "Users" -#~ msgstr "Benutzer" diff --git a/project_hr/i18n/es.po b/project_hr/i18n/es.po index f2df476ac8..96c175413d 100644 --- a/project_hr/i18n/es.po +++ b/project_hr/i18n/es.po @@ -126,9 +126,3 @@ msgid "" msgstr "" "No puede asignar un usuario que no pertenezca a la categoría de empleado " "seleccionada." - -#~ msgid "Linked employee" -#~ msgstr "Empleado relacionado" - -#~ msgid "Users" -#~ msgstr "Usuarios" diff --git a/project_hr/i18n/it.po b/project_hr/i18n/it.po index cb39387da8..f557f40d43 100644 --- a/project_hr/i18n/it.po +++ b/project_hr/i18n/it.po @@ -124,18 +124,3 @@ msgid "" msgstr "" "Impossibile assegnare un utente che non appartiene alla categoria dipendente " "selezionata." - -#~ msgid "Display Name" -#~ msgstr "Nome visualizzato" - -#~ msgid "ID" -#~ msgstr "ID" - -#~ msgid "Last Modified on" -#~ msgstr "Ultima modifica il" - -#~ msgid "Linked employee" -#~ msgstr "Dipendente collegato" - -#~ msgid "Users" -#~ msgstr "Utenti" diff --git a/project_hr/i18n/sl.po b/project_hr/i18n/sl.po index 20073c5a38..2ea90f2320 100644 --- a/project_hr/i18n/sl.po +++ b/project_hr/i18n/sl.po @@ -124,9 +124,3 @@ msgid "" "You can't assign a user not belonging to the selected employee category." msgstr "" "Ne morete dodeliti uporabnika, ki ne spada v izbrano kadrovsko kategorijo." - -#~ msgid "Linked employee" -#~ msgstr "Povezani kader" - -#~ msgid "Users" -#~ msgstr "Uporabniki" diff --git a/project_hr/models/project_task.py b/project_hr/models/project_task.py index d6e75c2f1c..96f6dd63d6 100644 --- a/project_hr/models/project_task.py +++ b/project_hr/models/project_task.py @@ -2,7 +2,7 @@ # Copyright 2019 Brainbean Apps (https://brainbeanapps.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, exceptions, fields, models +from odoo import api, exceptions, fields, models class ProjectTask(models.Model): @@ -17,27 +17,14 @@ class ProjectTask(models.Model): hr_category_ids = fields.Many2many( comodel_name="hr.employee.category", string="Employee Categories", - domain="[('id', 'in', allowed_hr_category_ids)]", + domain="domain_hr_category_ids", help="Here you can select the employee category suitable to perform " "this task, limiting the selectable users to be assigned to " "those that belongs to that category.", ) - allowed_hr_category_ids = fields.Many2many( - comodel_name="hr.employee.category", - string="Allowed HR categories", - compute="_compute_allowed_hr_category_ids", - help="Technical field for computing allowed employee categories " - "according categories at project level.", - ) - # This field could have been named allowed_user_ids but a field with - # that name already exists in the Odoo core 'project' module - allowed_assigned_user_ids = fields.Many2many( - comodel_name="res.users", - string="Allowed users", - compute="_compute_allowed_assigned_user_ids", - help="Technical field for computing allowed users according employee " - "category.", - ) + domain_hr_category_ids = fields.Binary(compute="_compute_domain_hr_category_ids") + user_ids = fields.Many2many(domain="domain_user_ids") + domain_user_ids = fields.Binary(compute="_compute_domain_user_ids") @api.depends("user_ids", "company_id") def _compute_employee_ids(self): @@ -48,17 +35,15 @@ def _compute_employee_ids(self): ) @api.depends("project_id", "project_id.hr_category_ids") - def _compute_allowed_hr_category_ids(self): - hr_category_obj = self.env["hr.employee.category"] + def _compute_domain_hr_category_ids(self): for task in self: + domain = [] if task.project_id.hr_category_ids: - task.allowed_hr_category_ids = task.project_id.hr_category_ids - else: - task.allowed_hr_category_ids = hr_category_obj.search([]) + domain = [("id", "in", task.project_id.hr_category_ids.ids)] + task.domain_hr_category_ids = domain @api.depends("hr_category_ids", "company_id") - def _compute_allowed_assigned_user_ids(self): - user_obj = self.env["res.users"] + def _compute_domain_user_ids(self): for task in self: domain = [("share", "=", False), ("active", "=", True)] if task.hr_category_ids: @@ -70,7 +55,7 @@ def _compute_allowed_assigned_user_ids(self): ), ("employee_ids.category_ids", "in", task.hr_category_ids.ids), ] - task.allowed_assigned_user_ids = user_obj.search(domain) + task.domain_user_ids = domain @api.constrains("hr_category_ids", "user_ids") def _check_employee_category_user(self): @@ -80,7 +65,7 @@ def _check_employee_category_user(self): x not in task.employee_ids.category_ids for x in task.hr_category_ids ): raise exceptions.ValidationError( - _( + self.env._( "You can't assign a user not belonging to the selected " "employee category." ) @@ -93,7 +78,7 @@ def _check_employee_category_project(self): task.hr_category_ids - task.project_id.hr_category_ids ): raise exceptions.ValidationError( - _( + self.env._( "You can't assign a category that is not allowed at " "project level." ) diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index 430fb46a79..82261b3cc7 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Project HR -

+
+

Project HR

- - -Odoo Community Association - -
-

Project HR

-

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects and provide technical fields with HR information:

    @@ -386,8 +381,8 @@

    Project HR

    or security restrictions.

    It also provides some facilities on project management:

      -
    • Limit selection of assigned users according selected employee category -at task level.
    • +
    • Limit selection of assigned users according selected employee +category at task level.
    • Limit selection of employee categories at task level depending on the selected categories at project level. All are shown if no categories at project level.
    • @@ -408,7 +403,7 @@

      Project HR

-

Configuration

+

Configuration

For setting employee categories at project level:

  1. Go to Project > Projects.
  2. @@ -428,7 +423,7 @@

    Configuration

-

Usage

+

Usage

  1. Go to Project > Search > Tasks.
  2. If there’s an employee category selected in the task, you will only @@ -437,7 +432,7 @@

    Usage

-

Known issues / Roadmap

+

Known issues / Roadmap

  • Limit project and task visibility according employee categories through overriding security methods (as through record rules is not @@ -445,23 +440,23 @@

    Known issues / Roadmap

-

Bug Tracker

+

Bug Tracker

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 -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -489,11 +484,10 @@

Maintainers

promote its widespread use.

Current maintainer:

pedrobaeza

-

This module is part of the OCA/project project on GitHub.

+

This module is part of the OCA/project project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

-
diff --git a/project_hr/tests/test_project_hr.py b/project_hr/tests/test_project_hr.py index 83fbd93519..501ef61291 100644 --- a/project_hr/tests/test_project_hr.py +++ b/project_hr/tests/test_project_hr.py @@ -1,15 +1,12 @@ # Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import logging - +from odoo import Command from odoo.exceptions import ValidationError from odoo.tests import new_test_user from odoo.addons.base.tests.common import BaseCommon -_logger = logging.getLogger(__name__) - class TestProjectHr(BaseCommon): @classmethod @@ -41,13 +38,13 @@ def setUpClass(cls): { "name": "Test employee", "user_id": cls.user1.id, - "category_ids": [(6, 0, cls.hr_category.ids)], + "category_ids": [Command.set(cls.hr_category.ids)], } ) cls.project = cls.env["project.project"].create( { "name": "Test project", - "hr_category_ids": [(4, cls.hr_category.id)], + "hr_category_ids": [Command.link(cls.hr_category.id)], "company_id": cls.env.company.id, } ) @@ -55,19 +52,19 @@ def setUpClass(cls): { "name": "Test task", "project_id": cls.project.id, - "hr_category_ids": [(4, cls.hr_category.id)], - "user_ids": [(6, 0, [cls.user1.id])], + "hr_category_ids": [Command.link(cls.hr_category.id)], + "user_ids": [Command.set(cls.user1.ids)], } ) def test_user(self): self.assertEqual(self.user1.hr_category_ids, self.hr_category) - self.employee.category_ids = [(4, self.hr_category_2.id)] + self.employee.category_ids = [Command.link(self.hr_category_2.id)] self.assertEqual( self.user1.hr_category_ids, self.hr_category + self.hr_category_2 ) # Check if need invalidate cache - self.employee.category_ids = [(4, self.hr_category_3.id)] + self.employee.category_ids = [Command.link(self.hr_category_3.id)] self.assertEqual( self.user1.hr_category_ids, self.hr_category + self.hr_category_2 + self.hr_category_3, @@ -75,36 +72,48 @@ def test_user(self): def test_task(self): # check computed values on task + category_model = self.env["hr.employee.category"] + user_model = self.env["res.users"] self.assertEqual(self.task.employee_ids, self.employee) - self.assertEqual(self.task.allowed_hr_category_ids, self.hr_category) - self.assertEqual(self.task.allowed_assigned_user_ids, self.user1) - self.project.hr_category_ids = [(4, self.hr_category_2.id)] - self.assertEqual( - self.task.allowed_hr_category_ids, self.hr_category + self.hr_category_2 - ) + task_categories = category_model.search(self.task.domain_hr_category_ids) + self.assertIn(self.hr_category, task_categories) + self.assertNotIn(self.hr_category_2, task_categories) + task_users = user_model.search(self.task.domain_user_ids) + self.assertIn(self.user1, task_users) + self.assertNotIn(self.user2, task_users) + self.project.hr_category_ids = [Command.link(self.hr_category_2.id)] + task_categories = category_model.search(self.task.domain_hr_category_ids) + self.assertIn(self.hr_category, task_categories) + self.assertIn(self.hr_category_2, task_categories) self.env["hr.employee"].create( { "name": "Test employee 2", "user_id": self.user2.id, - "category_ids": [(6, 0, self.hr_category.ids)], + "category_ids": [Command.set(self.hr_category.ids)], } ) - self.assertEqual(self.task.allowed_assigned_user_ids, self.user1 + self.user2) + task_users = user_model.search(self.task.domain_user_ids) + self.assertIn(self.user1, task_users) + self.assertIn(self.user2, task_users) # Test _check_employee_category_user constraint with self.assertRaises(ValidationError): - self.task.hr_category_ids = [(4, self.hr_category_2.id)] + self.task.hr_category_ids = [Command.link(self.hr_category_2.id)] # Test _check_employee_category_project constraint - self.project.hr_category_ids = [(4, self.hr_category_2.id)] + self.project.hr_category_ids = [Command.link(self.hr_category_2.id)] with self.assertRaises(ValidationError): - self.task.hr_category_ids = [(4, self.hr_category_2.id)] + self.task.hr_category_ids = [Command.link(self.hr_category_2.id)] # add employee to category hr_category_3 - self.employee.category_ids = [(4, self.hr_category_3.id)] + self.employee.category_ids = [Command.link(self.hr_category_3.id)] # test assign a category no in project categories with self.assertRaises(ValidationError): - self.task.hr_category_ids = [(4, self.hr_category_3.id)] + self.task.hr_category_ids = [Command.link(self.hr_category_3.id)] def test_task_project_wo_categories(self): self.project.hr_category_ids = False - self.assertTrue(self.task.allowed_hr_category_ids) + task_categories = self.env["hr.employee.category"].search( + self.task.domain_hr_category_ids + ) + self.assertIn(self.hr_category, task_categories) + self.assertIn(self.hr_category_2, task_categories) # This operation shouldn't give error - self.task.hr_category_ids = [(4, self.hr_category.id)] + self.task.hr_category_ids = [Command.link(self.hr_category.id)] diff --git a/project_hr/views/project_task_views.xml b/project_hr/views/project_task_views.xml index a0c077b67e..6f96896a60 100644 --- a/project_hr/views/project_task_views.xml +++ b/project_hr/views/project_task_views.xml @@ -11,19 +11,14 @@ - - + + - - [('id', 'in', allowed_assigned_user_ids)] - @@ -35,12 +30,7 @@ - - - - [('id', 'in', allowed_assigned_user_ids)] + @@ -50,12 +40,27 @@ - + - - [('id', 'in', allowed_assigned_user_ids)] + + + + project.task.kanban + project.task + + + + + + + + + project.task.activity + project.task + + + + From 87b7425978f040b1a1a2bec5e541f97d777aa477 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 9 Sep 2025 18:53:18 +0000 Subject: [PATCH 33/39] [UPD] Update project_hr.pot --- project_hr/i18n/project_hr.pot | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/project_hr/i18n/project_hr.pot b/project_hr/i18n/project_hr.pot index 37c292c844..9c4f7482f3 100644 --- a/project_hr/i18n/project_hr.pot +++ b/project_hr/i18n/project_hr.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 17.0\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -14,13 +14,18 @@ msgstr "" "Plural-Forms: \n" #. module: project_hr -#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_hr_category_ids -msgid "Allowed HR categories" +#: model:ir.model.fields,field_description:project_hr.field_project_task__user_ids +msgid "Assignees" msgstr "" #. module: project_hr -#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids -msgid "Allowed users" +#: model:ir.model.fields,field_description:project_hr.field_project_task__domain_hr_category_ids +msgid "Domain Hr Category" +msgstr "" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__domain_user_ids +msgid "Domain User" msgstr "" #. module: project_hr @@ -69,19 +74,6 @@ msgstr "" msgid "Task" msgstr "" -#. module: project_hr -#: model:ir.model.fields,help:project_hr.field_project_task__allowed_hr_category_ids -msgid "" -"Technical field for computing allowed employee categories according " -"categories at project level." -msgstr "" - -#. module: project_hr -#: model:ir.model.fields,help:project_hr.field_project_task__allowed_assigned_user_ids -msgid "" -"Technical field for computing allowed users according employee category." -msgstr "" - #. module: project_hr #: model:ir.model.fields,help:project_hr.field_res_users__hr_category_ids msgid "" @@ -97,14 +89,12 @@ msgstr "" #. module: project_hr #. odoo-python #: code:addons/project_hr/models/project_task.py:0 -#, python-format msgid "You can't assign a category that is not allowed at project level." msgstr "" #. module: project_hr #. odoo-python #: code:addons/project_hr/models/project_task.py:0 -#, python-format msgid "" "You can't assign a user not belonging to the selected employee category." msgstr "" From ecd29889a243ff1cd43aed21a16d63789df6be26 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 9 Sep 2025 18:57:41 +0000 Subject: [PATCH 34/39] [BOT] post-merge updates --- project_hr/README.rst | 48 +++++++++++++----------- project_hr/static/description/index.html | 36 ++++++++++-------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/project_hr/README.rst b/project_hr/README.rst index 4d2a5a0a5e..097a81327b 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ========== Project HR ========== @@ -7,13 +11,13 @@ Project HR !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:4e0d5c3e65e96a955c9316312be5178a728fe349f00b5843fb881a5be464af9f + !! source digest: sha256:7b8e67d127cec67545547879b6aae411eb22e220ca9fbf46bba87e8baa1159a7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github @@ -31,20 +35,20 @@ Project HR This is a technical module for adding some HR information to projects and provide technical fields with HR information: -- Employee categories at project and task level. -- Employee linked to the user assigned to a task. -- Employee categories at user level. +- Employee categories at project and task level. +- Employee linked to the user assigned to a task. +- Employee categories at user level. These fields can be used later for extra features like task scheduling or security restrictions. It also provides some facilities on project management: -- Limit selection of assigned users according selected employee - category at task level. -- Limit selection of employee categories at task level depending on the - selected categories at project level. All are shown if no categories - at project level. +- Limit selection of assigned users according selected employee category + at task level. +- Limit selection of employee categories at task level depending on the + selected categories at project level. All are shown if no categories + at project level. **Table of contents** @@ -82,9 +86,9 @@ Usage Known issues / Roadmap ====================== -- Limit project and task visibility according employee categories - through overriding security methods (as through record rules is not - possible without modifying existing ones). +- Limit project and task visibility according employee categories + through overriding security methods (as through record rules is not + possible without modifying existing ones). Bug Tracker =========== @@ -107,19 +111,19 @@ Authors Contributors ------------ -- `Tecnativa `__: +- `Tecnativa `__: - - Pedro M. Baeza - - Victor M.M. Torres - - Ernesto Tejeda - - Pilar Vargas + - Pedro M. Baeza + - Victor M.M. Torres + - Ernesto Tejeda + - Pilar Vargas -- `CorporateHub `__ +- `CorporateHub `__ - - Alexey Pelykh + - Alexey Pelykh -- Alfadil Tabar -- Abraham Anes +- Alfadil Tabar +- Abraham Anes Maintainers ----------- diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index 82261b3cc7..24ab07669e 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -3,7 +3,7 @@ -Project HR +README.rst -
-

Project HR

+
+ + +Odoo Community Association + +
+

Project HR

-

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects and provide technical fields with HR information:

    @@ -381,8 +386,8 @@

    Project HR

    or security restrictions.

    It also provides some facilities on project management:

      -
    • Limit selection of assigned users according selected employee -category at task level.
    • +
    • Limit selection of assigned users according selected employee category +at task level.
    • Limit selection of employee categories at task level depending on the selected categories at project level. All are shown if no categories at project level.
    • @@ -403,7 +408,7 @@

      Project HR

-

Configuration

+

Configuration

For setting employee categories at project level:

  1. Go to Project > Projects.
  2. @@ -423,7 +428,7 @@

    Configuration

-

Usage

+

Usage

  1. Go to Project > Search > Tasks.
  2. If there’s an employee category selected in the task, you will only @@ -432,7 +437,7 @@

    Usage

-

Known issues / Roadmap

+

Known issues / Roadmap

  • Limit project and task visibility according employee categories through overriding security methods (as through record rules is not @@ -440,7 +445,7 @@

    Known issues / Roadmap

-

Bug Tracker

+

Bug Tracker

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 @@ -448,15 +453,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -489,5 +494,6 @@

Maintainers

+
From bebd78dc77b47442806176f85ad3c917ce587d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 25 Feb 2026 12:44:46 +0100 Subject: [PATCH 35/39] [FIX] project_hr: Use the appropriate user employee TT61177 --- project_hr/models/res_users.py | 9 ++++- project_hr/tests/test_project_hr.py | 54 +++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/project_hr/models/res_users.py b/project_hr/models/res_users.py index f86ac45df5..89d6e07d37 100644 --- a/project_hr/models/res_users.py +++ b/project_hr/models/res_users.py @@ -1,4 +1,5 @@ # Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2026 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models @@ -16,8 +17,14 @@ class ResUsers(models.Model): ) @api.depends("company_id", "employee_ids", "employee_ids.category_ids") + @api.depends_context("allowed_company_ids", "company") def _compute_hr_category_ids(self): + """It is important to use the company employee (self.env.company) because + it is possible that the user's company (user.company_id) is not listed + as an allowed company (allowed_company_ids) and therefore the employee + is not in the employee_ids field. + """ for user in self: user.hr_category_ids = user.employee_ids.filtered( - lambda x, company_id=user.company_id: x.company_id == company_id + lambda x, company_id=self.env.company: x.company_id == company_id )[:1].category_ids diff --git a/project_hr/tests/test_project_hr.py b/project_hr/tests/test_project_hr.py index 501ef61291..c1db3c30f1 100644 --- a/project_hr/tests/test_project_hr.py +++ b/project_hr/tests/test_project_hr.py @@ -1,4 +1,5 @@ # Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2026 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import Command @@ -12,16 +13,22 @@ class TestProjectHr(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() + cls.company_a = cls.env.company + cls.company_b = cls.env["res.company"].create({"name": "Test company B"}) # Test users to use through the various tests cls.user1 = new_test_user( cls.env, login="test-user1", - groups="base.group_user,project.group_project_user", + groups="project.group_project_user", + company_id=cls.company_a.id, + company_ids=[Command.set((cls.company_a + cls.company_b).ids)], ) cls.user2 = new_test_user( cls.env, login="test-user2", - groups="base.group_user,project.group_project_user", + groups="project.group_project_user", + company_id=cls.company_a.id, + company_ids=[Command.set((cls.company_a + cls.company_b).ids)], ) cls.hr_category = cls.env["hr.employee.category"].create( {"name": "Test employee category"} @@ -37,6 +44,7 @@ def setUpClass(cls): cls.employee = cls.env["hr.employee"].create( { "name": "Test employee", + "company_id": cls.company_a.id, "user_id": cls.user1.id, "category_ids": [Command.set(cls.hr_category.ids)], } @@ -70,6 +78,47 @@ def test_user(self): self.hr_category + self.hr_category_2 + self.hr_category_3, ) + def test_user_multi_company(self): + # User with company A + allowed_company_ids=A: hr_category + user1_company_a = self.user1.with_company(self.company_a).with_context( + allowed_company_ids=self.company_a.ids + ) + user1_company_a.invalidate_recordset(["employee_ids"]) + self.assertIn(self.hr_category, user1_company_a.hr_category_ids) + self.assertNotIn(self.hr_category_3, user1_company_a.hr_category_ids) + self.assertNotIn(self.hr_category_3, user1_company_a.hr_category_ids) + # User with company B + allowed_company_ids=B: False + user1_company_b = self.user1.with_company(self.company_b).with_context( + allowed_company_ids=self.company_b.ids + ) + user1_company_b.invalidate_recordset(["employee_ids"]) + self.assertFalse(user1_company_b.hr_category_ids) + # create employee company b with hr_category_2 + self.env["hr.employee"].create( + { + "name": "Test employee", + "company_id": self.company_b.id, + "user_id": self.user1.id, + "category_ids": [(6, 0, self.hr_category_2.ids)], + } + ) + # User with company B + allowed_company_ids=B: hr_category_2 + user1_company_b = self.user1.with_company(self.company_b).with_context( + allowed_company_ids=self.company_b.ids + ) + user1_company_b.invalidate_recordset(["employee_ids"]) + self.assertNotIn(self.hr_category, user1_company_b.hr_category_ids) + self.assertIn(self.hr_category_2, user1_company_b.hr_category_ids) + self.assertNotIn(self.hr_category_3, user1_company_b.hr_category_ids) + # User with company A + allowed_company_ids=A+B: hr_category + user1_company_b = self.user1.with_company(self.company_a).with_context( + allowed_company_ids=(self.company_a + self.company_b).ids + ) + user1_company_b.invalidate_recordset(["employee_ids"]) + self.assertIn(self.hr_category, user1_company_b.hr_category_ids) + self.assertNotIn(self.hr_category_2, user1_company_b.hr_category_ids) + self.assertNotIn(self.hr_category_3, user1_company_b.hr_category_ids) + def test_task(self): # check computed values on task category_model = self.env["hr.employee.category"] @@ -89,6 +138,7 @@ def test_task(self): { "name": "Test employee 2", "user_id": self.user2.id, + "company_id": self.company_a.id, "category_ids": [Command.set(self.hr_category.ids)], } ) From 876fe87a5e101685f2b7660344d65170af80c587 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 26 Feb 2026 16:24:34 +0000 Subject: [PATCH 36/39] [BOT] post-merge updates --- project_hr/README.rst | 2 +- project_hr/__manifest__.py | 2 +- project_hr/static/description/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project_hr/README.rst b/project_hr/README.rst index 097a81327b..6843b02c15 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -11,7 +11,7 @@ Project HR !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:7b8e67d127cec67545547879b6aae411eb22e220ca9fbf46bba87e8baa1159a7 + !! source digest: sha256:b43664d9bc423eb83b494ef4c0bbbae19e38356194050e858733063cad475d8a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/project_hr/__manifest__.py b/project_hr/__manifest__.py index 2e5fff351e..f188a40df1 100644 --- a/project_hr/__manifest__.py +++ b/project_hr/__manifest__.py @@ -5,7 +5,7 @@ "name": "Project HR", "summary": "Link HR with project", "development_status": "Production/Stable", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/project", diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index 24ab07669e..b43d493d87 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -372,7 +372,7 @@

Project HR

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:7b8e67d127cec67545547879b6aae411eb22e220ca9fbf46bba87e8baa1159a7 +!! source digest: sha256:b43664d9bc423eb83b494ef4c0bbbae19e38356194050e858733063cad475d8a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects From c0dc9cb1c3c73adfa8f7f23f96ec6689b52546d2 Mon Sep 17 00:00:00 2001 From: Xavier Bol Date: Tue, 24 Mar 2026 23:16:50 +0100 Subject: [PATCH 37/39] [19.0][MIG] project_hr: Migration to 19.0 --- project_hr/README.rst | 11 ++++++----- project_hr/__manifest__.py | 2 +- project_hr/models/hr_employee.py | 5 ++--- project_hr/models/project_task.py | 2 +- project_hr/readme/CONTRIBUTORS.md | 1 + project_hr/static/description/index.html | 7 ++++--- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/project_hr/README.rst b/project_hr/README.rst index 6843b02c15..0d021f816a 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -21,13 +21,13 @@ Project HR :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github - :target: https://github.com/OCA/project/tree/18.0/project_hr + :target: https://github.com/OCA/project/tree/19.0/project_hr :alt: OCA/project .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_hr + :target: https://translation.odoo-community.org/projects/project-19-0/project-19-0-project_hr :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -96,7 +96,7 @@ Bug Tracker 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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -124,6 +124,7 @@ Contributors - Alfadil Tabar - Abraham Anes +- Xavier Bol Maintainers ----------- @@ -146,6 +147,6 @@ Current `maintainer `__: |maintainer-pedrobaeza| -This module is part of the `OCA/project `_ project on GitHub. +This module is part of the `OCA/project `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_hr/__manifest__.py b/project_hr/__manifest__.py index f188a40df1..4b6c4d504d 100644 --- a/project_hr/__manifest__.py +++ b/project_hr/__manifest__.py @@ -5,7 +5,7 @@ "name": "Project HR", "summary": "Link HR with project", "development_status": "Production/Stable", - "version": "18.0.1.0.1", + "version": "19.0.1.0.0", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/project", diff --git a/project_hr/models/hr_employee.py b/project_hr/models/hr_employee.py index 27971c6bee..ca91b41f1e 100644 --- a/project_hr/models/hr_employee.py +++ b/project_hr/models/hr_employee.py @@ -10,7 +10,6 @@ class HrEmployee(models.Model): @api.model_create_multi def create(self, vals_list): res = super().create(vals_list) - for vals in vals_list: - if vals.get("category_ids"): - self.env["project.task"].invalidate_model() + if any(vals.get("category_ids") for vals in vals_list): + self.env["project.task"].invalidate_model() return res diff --git a/project_hr/models/project_task.py b/project_hr/models/project_task.py index 96f6dd63d6..22ed579180 100644 --- a/project_hr/models/project_task.py +++ b/project_hr/models/project_task.py @@ -34,7 +34,7 @@ def _compute_employee_ids(self): == company_id ) - @api.depends("project_id", "project_id.hr_category_ids") + @api.depends("project_id.hr_category_ids") def _compute_domain_hr_category_ids(self): for task in self: domain = [] diff --git a/project_hr/readme/CONTRIBUTORS.md b/project_hr/readme/CONTRIBUTORS.md index 07a964412c..10017929b0 100644 --- a/project_hr/readme/CONTRIBUTORS.md +++ b/project_hr/readme/CONTRIBUTORS.md @@ -7,3 +7,4 @@ - Alexey Pelykh \ - Alfadil Tabar \ - Abraham Anes \ +- Xavier Bol \<\> diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index b43d493d87..57850355c7 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -374,7 +374,7 @@

Project HR

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:b43664d9bc423eb83b494ef4c0bbbae19e38356194050e858733063cad475d8a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects and provide technical fields with HR information:

@@ -489,7 +490,7 @@

Maintainers

promote its widespread use.

Current maintainer:

pedrobaeza

-

This module is part of the OCA/project project on GitHub.

+

This module is part of the OCA/project project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From e1844e20c45667a75349e80f05f07e1aef0b7a74 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Mon, 27 Apr 2026 07:24:25 +0000 Subject: [PATCH 38/39] [UPD] Update project_hr.pot --- project_hr/i18n/project_hr.pot | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/project_hr/i18n/project_hr.pot b/project_hr/i18n/project_hr.pot index 9c4f7482f3..f24257eec6 100644 --- a/project_hr/i18n/project_hr.pot +++ b/project_hr/i18n/project_hr.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 18.0\n" +"Project-Id-Version: Odoo Server 19.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -18,6 +18,14 @@ msgstr "" msgid "Assignees" msgstr "" +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_hr_employee__display_name +#: model:ir.model.fields,field_description:project_hr.field_project_project__display_name +#: model:ir.model.fields,field_description:project_hr.field_project_task__display_name +#: model:ir.model.fields,field_description:project_hr.field_res_users__display_name +msgid "Display Name" +msgstr "" + #. module: project_hr #: model:ir.model.fields,field_description:project_hr.field_project_task__domain_hr_category_ids msgid "Domain Hr Category" @@ -59,6 +67,14 @@ msgid "" "category." msgstr "" +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_hr_employee__id +#: model:ir.model.fields,field_description:project_hr.field_project_project__id +#: model:ir.model.fields,field_description:project_hr.field_project_task__id +#: model:ir.model.fields,field_description:project_hr.field_res_users__id +msgid "ID" +msgstr "" + #. module: project_hr #: model:ir.model.fields,field_description:project_hr.field_project_task__employee_ids msgid "Linked employees" @@ -81,6 +97,20 @@ msgid "" "user in the current company." msgstr "" +#. module: project_hr +#: model:ir.model.fields,help:project_hr.field_project_task__display_name +msgid "" +"Use these keywords in the title to set new tasks:\n" +"\n" +" #tags Set tags on the task\n" +" @user Assign the task to a user\n" +" ! Set the task a medium priority\n" +" !! Set the task a high priority\n" +" !!! Set the task a urgent priority\n" +"\n" +" Make sure to use the right format and order e.g. Improve the configuration screen #feature #v16 @Mitchell !" +msgstr "" + #. module: project_hr #: model:ir.model,name:project_hr.model_res_users msgid "User" From d1e6600a9ed57220b49a4bfcc1ab0c4f70e023d8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 27 Apr 2026 07:27:12 +0000 Subject: [PATCH 39/39] [BOT] post-merge updates --- README.md | 1 + project_hr/README.rst | 2 +- project_hr/static/description/index.html | 2 +- setup/_metapackage/pyproject.toml | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9224100541..7126a30b43 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Available addons addon | version | maintainers | summary --- | --- | --- | --- [project_department](project_department/) | 19.0.1.0.0 | | Project Department Categorization +[project_hr](project_hr/) | 19.0.1.0.0 | pedrobaeza | Link HR with project [project_key](project_key/) | 19.0.1.0.0 | | Module decorates projects and tasks with Project Key [project_parent_task_filter](project_parent_task_filter/) | 19.0.1.0.0 | | Add a filter to show the parent tasks [project_sequence](project_sequence/) | 19.0.1.0.0 | yajo anddago78 | Add a sequence field to projects, filled automatically diff --git a/project_hr/README.rst b/project_hr/README.rst index 0d021f816a..f6eed18c7e 100644 --- a/project_hr/README.rst +++ b/project_hr/README.rst @@ -11,7 +11,7 @@ Project HR !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b43664d9bc423eb83b494ef4c0bbbae19e38356194050e858733063cad475d8a + !! source digest: sha256:233d138c5d92df5e49943c7dac0a09769f6e61a2bf8fd7bdbac542fbf136697e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html index 57850355c7..413a76b0d0 100644 --- a/project_hr/static/description/index.html +++ b/project_hr/static/description/index.html @@ -372,7 +372,7 @@

Project HR

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:b43664d9bc423eb83b494ef4c0bbbae19e38356194050e858733063cad475d8a +!! source digest: sha256:233d138c5d92df5e49943c7dac0a09769f6e61a2bf8fd7bdbac542fbf136697e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

This is a technical module for adding some HR information to projects diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index fc0567f276..c772b7a992 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,8 +1,9 @@ [project] name = "odoo-addons-oca-project" -version = "19.0.20260331.0" +version = "19.0.20260427.0" dependencies = [ "odoo-addon-project_department==19.0.*", + "odoo-addon-project_hr==19.0.*", "odoo-addon-project_key==19.0.*", "odoo-addon-project_parent_task_filter==19.0.*", "odoo-addon-project_sequence==19.0.*",