diff --git a/project_multi_department/README.rst b/project_multi_department/README.rst new file mode 100644 index 0000000000..5afaf56a9c --- /dev/null +++ b/project_multi_department/README.rst @@ -0,0 +1,81 @@ +======================================= +Project Multi Department Classification +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8727e585123eb8d435fff77da2a505840522927a18ab1e828273c0b4f6d690ab + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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/18.0/project_multi_department + :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_multi_department + :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 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to assign Departments to Projects. The default +security rules allow members of departments to access the department +related projects and tasks + +If you want to assign only one department to projects you might like +project_department module + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* INVITU + +Contributors +------------ + +- Cyril VINH-TUNG + +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. + +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_multi_department/__init__.py b/project_multi_department/__init__.py new file mode 100644 index 0000000000..3c8fc075db --- /dev/null +++ b/project_multi_department/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2026 INVITU () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/project_multi_department/__manifest__.py b/project_multi_department/__manifest__.py new file mode 100644 index 0000000000..beb2128a14 --- /dev/null +++ b/project_multi_department/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 INVITU () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Project Multi Department Classification", + "summary": "This module add a link between projects and several departments", + "version": "18.0.1.0.0", + "author": "INVITU, Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Generic Modules/Projects & Services", + "website": "https://github.com/OCA/project", + "depends": [ + "project", + "hr", + ], + "data": ["security/project_security.xml", "views/project_project_views.xml"], + "installable": True, +} diff --git a/project_multi_department/models/__init__.py b/project_multi_department/models/__init__.py new file mode 100644 index 0000000000..ad29b1fcdb --- /dev/null +++ b/project_multi_department/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2026 INVITU () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import project_project +from . import project_task diff --git a/project_multi_department/models/project_project.py b/project_multi_department/models/project_project.py new file mode 100644 index 0000000000..24a9696a07 --- /dev/null +++ b/project_multi_department/models/project_project.py @@ -0,0 +1,14 @@ +# Copyright 2026 INVITU () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ProjectProject(models.Model): + _inherit = "project.project" + + department_ids = fields.Many2many( + comodel_name="hr.department", + string="Project Departments", + default=lambda self: self.env.user.employee_id.department_id, + ) diff --git a/project_multi_department/models/project_task.py b/project_multi_department/models/project_task.py new file mode 100644 index 0000000000..2d3da297b3 --- /dev/null +++ b/project_multi_department/models/project_task.py @@ -0,0 +1,12 @@ +# Copyright 2026 INVITU () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ProjectTask(models.Model): + _inherit = "project.task" + + department_ids = fields.Many2many( + related="project_id.department_ids", + ) diff --git a/project_multi_department/pyproject.toml b/project_multi_department/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/project_multi_department/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/project_multi_department/readme/CONTRIBUTORS.md b/project_multi_department/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..e552444b74 --- /dev/null +++ b/project_multi_department/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Cyril VINH-TUNG \<\> diff --git a/project_multi_department/readme/DESCRIPTION.md b/project_multi_department/readme/DESCRIPTION.md new file mode 100644 index 0000000000..726b9207da --- /dev/null +++ b/project_multi_department/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module allows to assign Departments to Projects. +The default security rules allow members of departments to access the department related projects and tasks + +If you want to assign only one department to projects you might like project_department module diff --git a/project_multi_department/security/project_security.xml b/project_multi_department/security/project_security.xml new file mode 100644 index 0000000000..ba652078b5 --- /dev/null +++ b/project_multi_department/security/project_security.xml @@ -0,0 +1,27 @@ + + + + Project Multi Department Rule + + [ + '&', + ('privacy_visibility', '!=', 'followers'), + '|', + ('department_ids', 'child_of', user.employee_id.department_id.ids ), + ('department_ids', '=', False ) + ] + + + + Project Task Multi Department Rule + + [ + '&', + ('project_id.privacy_visibility', '!=', 'followers'), + '|', + ('department_ids', 'child_of', user.employee_id.department_id.ids ), + ('department_ids', '=', False ) + ] + + + diff --git a/project_multi_department/static/description/icon.png b/project_multi_department/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/project_multi_department/static/description/icon.png differ diff --git a/project_multi_department/static/description/index.html b/project_multi_department/static/description/index.html new file mode 100644 index 0000000000..e08889f98e --- /dev/null +++ b/project_multi_department/static/description/index.html @@ -0,0 +1,427 @@ + + + + + +Project Multi Department Classification + + + +
+

Project Multi Department Classification

+ + +

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

+

This module allows to assign Departments to Projects. The default +security rules allow members of departments to access the department +related projects and tasks

+

If you want to assign only one department to projects you might like +project_department module

+

Table of contents

+ +
+

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

+
    +
  • INVITU
  • +
+
+
+

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.

+

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_multi_department/views/project_project_views.xml b/project_multi_department/views/project_project_views.xml new file mode 100644 index 0000000000..09fd72cf1b --- /dev/null +++ b/project_multi_department/views/project_project_views.xml @@ -0,0 +1,47 @@ + + + project.project.form.multi.department + project.project + + form + + + + + + + + + + project.project.select + project.project + + search + + + + + + + + + + + + + project.project.list + project.project + + list + + + + + + + +