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 new file mode 100644 index 0000000000..f6eed18c7e --- /dev/null +++ b/project_hr/README.rst @@ -0,0 +1,152 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========== +Project HR +========== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:233d138c5d92df5e49943c7dac0a09769f6e61a2bf8fd7bdbac542fbf136697e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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 + :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/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-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=19.0 + :alt: Try me on Runboat + +|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: + +1. Go to *Project > Projects*. +2. Click on the 3 vertical dots of one of the project kanban cards 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 > All 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). + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__: + + - Pedro M. Baeza + - Victor M.M. Torres + - Ernesto Tejeda + - Pilar Vargas + +- `CorporateHub `__ + + - Alexey Pelykh + +- Alfadil Tabar +- Abraham Anes +- Xavier Bol + +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..4b6c4d504d --- /dev/null +++ b/project_hr/__manifest__.py @@ -0,0 +1,15 @@ +# 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": "19.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/ca.po b/project_hr/i18n/ca.po new file mode 100644 index 0000000000..5607d4adf9 --- /dev/null +++ b/project_hr/i18n/ca.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-11-18 17:36+0000\n" +"Last-Translator: pere-aquarian \n" +"Language-Team: none\n" +"Language: ca\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 4.3.2\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Categories de RRHH permeses" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids +msgid "Allowed users" +msgstr "Usuaris/àries permesos/es" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Empleat/da" + +#. 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 "Categories d'empleat/da" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "Categories de RRHH" + +#. 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í pot enllaçar el projecte a vàries categories de l'empleat/da, que seran " +"les permeses a les tasques." + +#. 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 "" +"Aquí pot seleccionar la categoria de l'empleat/da adequada per a realitzar " +"aquesta tasca, limitant els/les usuaris/àries seleccionables per a ser " +"assignats/ades a aquells que pertanyen a la categoria." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__employee_ids +msgid "Linked employees" +msgstr "" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Projecte" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Tasca" + +#. 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 "" +"Camp tècnic per a calcular les categories de l'empleat/da permeses conforme " +"a les categories establertes a nivell de projecte." + +#. 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 "" +"Camp tècnic per a calcular els/les usuaris/àries permesos/es conforme a les " +"categories establertes a nivell d'empleat/ada." + +#. 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 "" +"Camp tècnic per a calcular dinàmicament les categories de l'empleat/da " +"relacionat/da a l'usuari de la companyia actual." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "User" +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 "" +"No pot assignar una categoria que no està permesa a nivell de projecte." + +#. 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 "" +"No pot assignar un/a usuari/ària que no pertany a la categoria d'empleat/ada " +"seleccionada." diff --git a/project_hr/i18n/de.po b/project_hr/i18n/de.po new file mode 100644 index 0000000000..12a4ac6754 --- /dev/null +++ b/project_hr/i18n/de.po @@ -0,0 +1,127 @@ +# 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: 2023-06-20 11:10+0000\n" +"Last-Translator: Nils Coenen \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 4.17\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_assigned_user_ids +msgid "Allowed users" +msgstr "Erlaubte Benutzer" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Mitarbeiter" + +#. 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_ids +msgid "Linked employees" +msgstr "Verknüpfte 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_assigned_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 "User" +msgstr "Benutzer" + +#. 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 "" +"Es darf keine Kategorie zu der Aufgabe hinzugefügt werden, die auf " +"Projektebene nicht erlaubt wurde." + +#. 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 "" +"Der Aufgabe darf kein Benutzer zugewiesen werden, der nicht zur gewählten " +"Mitarbeiter-Kategorie gehört." diff --git a/project_hr/i18n/es.po b/project_hr/i18n/es.po new file mode 100644 index 0000000000..96c175413d --- /dev/null +++ b/project_hr/i18n/es.po @@ -0,0 +1,128 @@ +# 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: 2023-09-03 13:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \n" +"Language: es\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 4.17\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_assigned_user_ids +msgid "Allowed users" +msgstr "Usuarios permitidos" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Empleado/a" + +#. 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,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "Categorías RRHH" + +#. 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_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 "" +"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_project_task__employee_ids +msgid "Linked employees" +msgstr "Empleados relacionados" + +#. 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_assigned_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 "User" +msgstr "Usuario" + +#. 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 "" +"No puede asignar una categoría que no está permitida a nivel de proyecto." + +#. 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 "" +"No puede asignar un usuario que no pertenezca a la categoría de empleado " +"seleccionada." diff --git a/project_hr/i18n/hr.po b/project_hr/i18n/hr.po new file mode 100644 index 0000000000..c86b30e73c --- /dev/null +++ b/project_hr/i18n/hr.po @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-12-02 16:28+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.9.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 "Dozvoljene kategorije HR" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids +msgid "Allowed users" +msgstr "Dozvoljeno korisnicima" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Djelatnik" + +#. 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 djelatnika" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "HR 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 "" + +#. 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_ids +msgid "Linked employees" +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_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 "" +"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 "User" +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 "" diff --git a/project_hr/i18n/it.po b/project_hr/i18n/it.po new file mode 100644 index 0000000000..f557f40d43 --- /dev/null +++ b/project_hr/i18n/it.po @@ -0,0 +1,126 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-05-29 12:09+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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 4.17\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Categorie RU consentite" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids +msgid "Allowed users" +msgstr "Utenti consentiti" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Dipendente" + +#. 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 "Categorie dipendente" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "Categorie RU" + +#. 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 "" +"Qui è possibile collegare il progetto a diverse categorie dipendenti, che " +"verranno abilitate nei lavori." + +#. 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 "" +"Qui è possibile selezionare la categorie dipendente adeguata ad eseguire " +"questo lavoro, limitando i dipendenti selezionabili a quelli che " +"appartengono a quella categoria." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__employee_ids +msgid "Linked employees" +msgstr "Dipendente collegato" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Progetto" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Lavoro" + +#. 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 tecnico per calcolare le categorie dipendenti autorizzate in accordo " +"con le categorie a livello progetto." + +#. 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 "" +"Campo tecnico per calcolare gli utenti abilitati in accordo alle categorie " +"dipendenti." + +#. 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 tecnico per calcolare dinamicamente le categorie dipendenti collegate " +"agli utenti nell'azienda attuale." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "User" +msgstr "Utente" + +#. 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 "Impossibile assegnare una categoria non consentita a livello progetto." + +#. 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 "" +"Impossibile assegnare un utente che non appartiene alla categoria dipendente " +"selezionata." diff --git a/project_hr/i18n/nl.po b/project_hr/i18n/nl.po new file mode 100644 index 0000000000..f85b4f299f --- /dev/null +++ b/project_hr/i18n/nl.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-09 02:52+0000\n" +"Last-Translator: \"Jan Tapper [Onestein]\" \n" +"Language-Team: none\n" +"Language: nl\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 4.17\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Toegestane HR-categorieën" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids +msgid "Allowed users" +msgstr "Toegestane gebruikers" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Medewerker" + +#. 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 "Categorieën van werknemers" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "HR-categorieën" + +#. 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 "" +"Hier kunt u het project koppelen aan verschillende medewerkerscategorieën, " +"die toegestaan zijn in taken." + +#. 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 "" +"Hier kunt u de werknemerscategorie selecteren die geschikt is om deze taak " +"uit te voeren, waardoor de selecteerbare gebruikers worden beperkt tot " +"degenen die tot die categorie behoren." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__employee_ids +msgid "Linked employees" +msgstr "Gekoppelde medewerkers" + +#. 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 "Taak" + +#. 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 "" +"Technisch veld voor het berekenen van toegestane werknemerscategorieën " +"volgens categorieën op projectniveau." + +#. 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 "" +"Technisch veld voor computers met toegestane gebruikers volgens " +"werknemerscategorie." + +#. 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 "" +"Technisch veld voor het dynamisch berekenen van werknemerscategorieën die " +"zijn gekoppeld aan de gebruiker in het huidige bedrijf." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "User" +msgstr "Gebruiker" + +#. 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 "" +"U kunt geen categorie toekennen die niet is toegestaan op projectniveau." + +#. 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 "" +"U kunt geen gebruiker toewijzen die niet tot de geselecteerde " +"werknemerscategorie behoort." diff --git a/project_hr/i18n/project_hr.pot b/project_hr/i18n/project_hr.pot new file mode 100644 index 0000000000..f24257eec6 --- /dev/null +++ b/project_hr/i18n/project_hr.pot @@ -0,0 +1,130 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.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__user_ids +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" +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 +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +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_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" +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_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.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" +msgstr "" + +#. module: project_hr +#. odoo-python +#: code:addons/project_hr/models/project_task.py:0 +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 +msgid "" +"You can't assign a user not belonging to the selected employee category." +msgstr "" diff --git a/project_hr/i18n/pt_BR.po b/project_hr/i18n/pt_BR.po new file mode 100644 index 0000000000..79a7fe83ee --- /dev/null +++ b/project_hr/i18n/pt_BR.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_hr +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-28 13:27+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: none\n" +"Language: pt_BR\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 4.17\n" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_hr_category_ids +msgid "Allowed HR categories" +msgstr "Categorias de RH permitidas" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__allowed_assigned_user_ids +msgid "Allowed users" +msgstr "Usuários permitidos" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Funcionário" + +#. 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 "Categorias de Funcionários" + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_res_users__hr_category_ids +msgid "HR categories" +msgstr "Categorias de RH" + +#. 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 "" +"Aqui você pode vincular o projeto a diversas categorias de funcionários, que " +"serão permitidas nas tarefas." + +#. 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 "" +"Aqui você pode selecionar a categoria de funcionário adequada para realizar " +"esta tarefa, limitando os usuários selecionáveis a serem atribuídos àqueles " +"que pertencem a essa categoria." + +#. module: project_hr +#: model:ir.model.fields,field_description:project_hr.field_project_task__employee_ids +msgid "Linked employees" +msgstr "Funcionários vinculados" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_project +msgid "Project" +msgstr "Projeto" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_project_task +msgid "Task" +msgstr "Tarefa" + +#. 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 categorias de funcionários permitidas de acordo " +"com categorias em nível de projeto." + +#. 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 "" +"Campo técnico para calcular usuários permitidos de acordo com a categoria " +"funcional." + +#. 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 cálculo dinâmico de categorias de funcionários vinculadas " +"ao usuário na empresa atual." + +#. module: project_hr +#: model:ir.model,name:project_hr.model_res_users +msgid "User" +msgstr "Usuário" + +#. 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 "" +"Você não pode atribuir uma categoria que não seja permitida no nível do " +"projeto." + +#. 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 "" +"Você não pode atribuir um usuário que não pertença à categoria de " +"funcionário selecionada." diff --git a/project_hr/i18n/sl.po b/project_hr/i18n/sl.po new file mode 100644 index 0000000000..2ea90f2320 --- /dev/null +++ b/project_hr/i18n/sl.po @@ -0,0 +1,126 @@ +# 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-10-24 07:33+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.8\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_assigned_user_ids +msgid "Allowed users" +msgstr "Dovoljeni uporabniki" + +#. module: project_hr +#: model:ir.model,name:project_hr.model_hr_employee +msgid "Employee" +msgstr "Kader" + +#. 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_ids +msgid "Linked employees" +msgstr "" + +#. 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_assigned_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 "User" +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 "Kategorije, ki ni dovoljena na projektnem nivoju, ne morete dodeliti." + +#. 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 "" +"Ne morete dodeliti uporabnika, ki ne spada v izbrano kadrovsko kategorijo." diff --git a/project_hr/models/__init__.py b/project_hr/models/__init__.py new file mode 100644 index 0000000000..f1a859937b --- /dev/null +++ b/project_hr/models/__init__.py @@ -0,0 +1,6 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import project_project +from . import project_task +from . import res_users +from . import hr_employee diff --git a/project_hr/models/hr_employee.py b/project_hr/models/hr_employee.py new file mode 100644 index 0000000000..ca91b41f1e --- /dev/null +++ b/project_hr/models/hr_employee.py @@ -0,0 +1,15 @@ +# Copyright 2019 Tecnativa - Victor M.M. Torres +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + @api.model_create_multi + def create(self, vals_list): + res = super().create(vals_list) + 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_project.py b/project_hr/models/project_project.py new file mode 100644 index 0000000000..036a5c43a4 --- /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..22ed579180 --- /dev/null +++ b/project_hr/models/project_task.py @@ -0,0 +1,85 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# 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 + + +class ProjectTask(models.Model): + _inherit = "project.task" + + employee_ids = fields.Many2many( + comodel_name="hr.employee", + string="Linked employees", + compute="_compute_employee_ids", + store=True, + ) + hr_category_ids = fields.Many2many( + comodel_name="hr.employee.category", + string="Employee Categories", + 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.", + ) + 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): + for task in self.filtered("user_ids"): + task.employee_ids = task.user_ids.employee_ids.filtered( + lambda x, company_id=task.company_id or self.env.company: x.company_id + == company_id + ) + + @api.depends("project_id.hr_category_ids") + def _compute_domain_hr_category_ids(self): + for task in self: + domain = [] + if task.project_id.hr_category_ids: + 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_domain_user_ids(self): + for task in self: + domain = [("share", "=", False), ("active", "=", True)] + if task.hr_category_ids: + domain = [ + ( + "employee_ids.company_id", + "=", + (task.company_id.id or self.env.company.id), + ), + ("employee_ids.category_ids", "in", task.hr_category_ids.ids), + ] + task.domain_user_ids = domain + + @api.constrains("hr_category_ids", "user_ids") + 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_ids): + if any( + 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." + ) + ) + + @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( + self.env._( + "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..89d6e07d37 --- /dev/null +++ b/project_hr/models/res_users.py @@ -0,0 +1,30 @@ +# 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 + + +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") + @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=self.env.company: x.company_id == company_id + )[:1].category_ids diff --git a/project_hr/pyproject.toml b/project_hr/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/project_hr/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/project_hr/readme/CONFIGURE.md b/project_hr/readme/CONFIGURE.md new file mode 100644 index 0000000000..b242e10472 --- /dev/null +++ b/project_hr/readme/CONFIGURE.md @@ -0,0 +1,16 @@ +For setting employee categories at project level: + +1. Go to *Project \> Projects*. +2. Click on the 3 vertical dots of one of the project kanban cards 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 \> All 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. diff --git a/project_hr/readme/CONTRIBUTORS.md b/project_hr/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..10017929b0 --- /dev/null +++ b/project_hr/readme/CONTRIBUTORS.md @@ -0,0 +1,10 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Victor M.M. Torres + - Ernesto Tejeda + - Pilar Vargas +- [CorporateHub](https://corporatehub.eu/) + - Alexey Pelykh \ +- Alfadil Tabar \ +- Abraham Anes \ +- Xavier Bol \<\> diff --git a/project_hr/readme/DESCRIPTION.md b/project_hr/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9104f7f612 --- /dev/null +++ b/project_hr/readme/DESCRIPTION.md @@ -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.md b/project_hr/readme/ROADMAP.md new file mode 100644 index 0000000000..ebeb69ce11 --- /dev/null +++ b/project_hr/readme/ROADMAP.md @@ -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.md b/project_hr/readme/USAGE.md new file mode 100644 index 0000000000..70eccb055d --- /dev/null +++ b/project_hr/readme/USAGE.md @@ -0,0 +1,4 @@ +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. diff --git a/project_hr/static/description/icon.png b/project_hr/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/project_hr/static/description/icon.png differ diff --git a/project_hr/static/description/index.html b/project_hr/static/description/index.html new file mode 100644 index 0000000000..413a76b0d0 --- /dev/null +++ b/project_hr/static/description/index.html @@ -0,0 +1,500 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Project HR

+ +

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:

+
    +
  • 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 > Projects.
  2. +
  3. Click on the 3 vertical dots of one of the project kanban cards 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 > All 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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

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..c1db3c30f1 --- /dev/null +++ b/project_hr/tests/test_project_hr.py @@ -0,0 +1,169 @@ +# 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 +from odoo.exceptions import ValidationError +from odoo.tests import new_test_user + +from odoo.addons.base.tests.common import BaseCommon + + +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="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="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"} + ) + cls.hr_category_2 = cls.env["hr.employee.category"].create( + {"name": "Test employee category 2"} + ) + + cls.hr_category_3 = cls.env["hr.employee.category"].create( + {"name": "Test employee category 3"} + ) + + 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)], + } + ) + cls.project = cls.env["project.project"].create( + { + "name": "Test project", + "hr_category_ids": [Command.link(cls.hr_category.id)], + "company_id": cls.env.company.id, + } + ) + cls.task = cls.env["project.task"].create( + { + "name": "Test task", + "project_id": cls.project.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 = [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 = [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, + ) + + 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"] + user_model = self.env["res.users"] + self.assertEqual(self.task.employee_ids, self.employee) + 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, + "company_id": self.company_a.id, + "category_ids": [Command.set(self.hr_category.ids)], + } + ) + 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 = [Command.link(self.hr_category_2.id)] + # Test _check_employee_category_project constraint + self.project.hr_category_ids = [Command.link(self.hr_category_2.id)] + with self.assertRaises(ValidationError): + self.task.hr_category_ids = [Command.link(self.hr_category_2.id)] + # add employee to category hr_category_3 + 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 = [Command.link(self.hr_category_3.id)] + + def test_task_project_wo_categories(self): + self.project.hr_category_ids = False + 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 = [Command.link(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..d8a2e767cb --- /dev/null +++ b/project_hr/views/project_project_views.xml @@ -0,0 +1,15 @@ + + + + + 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..6f96896a60 --- /dev/null +++ b/project_hr/views/project_task_views.xml @@ -0,0 +1,67 @@ + + + + + Project task form: Add linked employee and Employee category + project.task + + + + + + + + + + + + + + project.task.form.quick_create + project.task + + + + + + + + + project.task.tree + project.task + + + + + + + + + project.task.kanban + project.task + + + + + + + + + project.task.activity + project.task + + + + + + + + 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.*",