diff --git a/project_parent/README.rst b/project_parent/README.rst new file mode 100644 index 0000000000..44540d0cc9 --- /dev/null +++ b/project_parent/README.rst @@ -0,0 +1,99 @@ +============== +Project Parent +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d693b4489312acc2097bf5250d4e165782cf6bf7739c0bfc7652b07fcb05121b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-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_parent + :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_parent + :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 introduces project parent and childs fields. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +In Kanban View: + +1. Go to Project > Dashboard +2. Group by "Parent Project" + +In Tree View: + +1. Go to Project >Configuration > Projects +2. Group by "Parent Project" + +In form View: + +1. Go to Project > Dashboard +2. Open the projects settings +3. Modify the "Parent Project" in settings tab + +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 +------- + +* Therp B.V. +* Elico Corp + +Contributors +------------ + +- Eric Caudal +- Giovanni Francesco Capalbo +- Thomas Fossoul +- ``Heliconia Solutions Pvt. Ltd. ``\ \_ + +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_parent/__init__.py b/project_parent/__init__.py new file mode 100644 index 0000000000..83e553ac46 --- /dev/null +++ b/project_parent/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/project_parent/__manifest__.py b/project_parent/__manifest__.py new file mode 100644 index 0000000000..7a8811bd59 --- /dev/null +++ b/project_parent/__manifest__.py @@ -0,0 +1,13 @@ +# © 2017-2019 Elico Corp (https://www.elico-corp.com). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Project Parent", + "version": "18.0.1.0.0", + "license": "LGPL-3", + "category": "project", + "author": "Therp B.V., Elico Corp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/project", + "depends": ["project"], + "data": ["views/project_parent_views.xml"], + "demo": ["demo/project_project_demo.xml"], +} diff --git a/project_parent/demo/project_project_demo.xml b/project_parent/demo/project_project_demo.xml new file mode 100644 index 0000000000..7a9f8ecacb --- /dev/null +++ b/project_parent/demo/project_project_demo.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/project_parent/i18n/es.po b/project_parent/i18n/es.po new file mode 100644 index 0000000000..33176717fb --- /dev/null +++ b/project_parent/i18n/es.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 01:51+0000\n" +"PO-Revision-Date: 2023-10-12 15:38+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "Recuento de ID de niños" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "Proyectos Hijos" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "Ruta Parental" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Proyecto Padre" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "Proyecto" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "Sub-proyectos" + +#~ msgid "Analytic Account" +#~ msgstr "Cuenta analítica" + +#~ msgid "Parent" +#~ msgstr "Padre" + +#~ msgid "WBS element" +#~ msgstr "WBS elemento" diff --git a/project_parent/i18n/fr.po b/project_parent/i18n/fr.po new file mode 100644 index 0000000000..1fb57bafa5 --- /dev/null +++ b/project_parent/i18n/fr.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-25 16:43+0000\n" +"PO-Revision-Date: 2020-08-25 16:43+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "Sous projets" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "Chemin du Parent" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Projet Parent" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "Projet" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "Sous projets" diff --git a/project_parent/i18n/hr.po b/project_parent/i18n/hr.po new file mode 100644 index 0000000000..c62f41b2b2 --- /dev/null +++ b/project_parent/i18n/hr.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 01:51+0000\n" +"PO-Revision-Date: 2018-02-02 01:51+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\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" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Nadređeni projekt" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +#, fuzzy +msgid "Project" +msgstr "Nadređeni projekt" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analitički konto" + +#~ msgid "Parent" +#~ msgstr "Nadređeni" diff --git a/project_parent/i18n/it.po b/project_parent/i18n/it.po new file mode 100644 index 0000000000..ccbee43b7f --- /dev/null +++ b/project_parent/i18n/it.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-11-30 12:06+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 5.6.2\n" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "Conteggio ID figli" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "Progetti figli" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "Percorso padre" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Progetto padre" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "Progetto" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "Sotto progetto" diff --git a/project_parent/i18n/nl.po b/project_parent/i18n/nl.po new file mode 100644 index 0000000000..45fc9db974 --- /dev/null +++ b/project_parent/i18n/nl.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-07 11:39+0000\n" +"Last-Translator: Thijs van Oers \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_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "Aantal onderliggende ids" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "Onderliggende projecten" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "Bovenliggend pad" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Hoofdproject" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "Project" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "Sub projecten" diff --git a/project_parent/i18n/nl_NL.po b/project_parent/i18n/nl_NL.po new file mode 100644 index 0000000000..9bf8c9aba6 --- /dev/null +++ b/project_parent/i18n/nl_NL.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-22 01:55+0000\n" +"PO-Revision-Date: 2017-12-22 01:55+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_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" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analytische Rekening" diff --git a/project_parent/i18n/project_parent.pot b/project_parent/i18n/project_parent.pot new file mode 100644 index 0000000000..1e14151756 --- /dev/null +++ b/project_parent/i18n/project_parent.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "" diff --git a/project_parent/i18n/pt_BR.po b/project_parent/i18n/pt_BR.po new file mode 100644 index 0000000000..ecadadc373 --- /dev/null +++ b/project_parent/i18n/pt_BR.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +# Translators: +# Mateus Lopes , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-22 01:55+0000\n" +"PO-Revision-Date: 2023-10-28 09:42+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\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_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "Nº de Filhos" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "Projetos Filhos" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "Caminho Superior" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Projeto Pai" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +msgid "Project" +msgstr "Projeto" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "Sub-projetos" + +#~ msgid "Analytic Account" +#~ msgstr "Conta Analítica" + +#~ msgid "Parent" +#~ msgstr "Pai" diff --git a/project_parent/i18n/sl.po b/project_parent/i18n/sl.po new file mode 100644 index 0000000000..d308c301b4 --- /dev/null +++ b/project_parent/i18n/sl.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_parent +# +# Translators: +# Matjaž Mozetič , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 01:51+0000\n" +"PO-Revision-Date: 2018-02-02 01:51+0000\n" +"Last-Translator: Matjaž Mozetič , 2018\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\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" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids_count +msgid "Child Ids Count" +msgstr "" + +#. module: project_parent +#: model_terms:ir.ui.view,arch_db:project_parent.edit_project +msgid "Child Projects" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_path +msgid "Parent Path" +msgstr "" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__parent_id +#: model_terms:ir.ui.view,arch_db:project_parent.view_project_project_filter +msgid "Parent Project" +msgstr "Nadrejeni projekt" + +#. module: project_parent +#: model:ir.model,name:project_parent.model_project_project +#, fuzzy +msgid "Project" +msgstr "Nadrejeni projekt" + +#. module: project_parent +#: model:ir.model.fields,field_description:project_parent.field_project_project__child_ids +msgid "Sub-projects" +msgstr "" + +#~ msgid "Analytic Account" +#~ msgstr "Analitični konto" + +#~ msgid "Parent" +#~ msgstr "Nadrejeni" diff --git a/project_parent/models/__init__.py b/project_parent/models/__init__.py new file mode 100644 index 0000000000..d527100817 --- /dev/null +++ b/project_parent/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import project_project diff --git a/project_parent/models/project_project.py b/project_parent/models/project_project.py new file mode 100644 index 0000000000..3eda8a9e5f --- /dev/null +++ b/project_parent/models/project_project.py @@ -0,0 +1,42 @@ +# Copyright 2019 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class Project(models.Model): + _inherit = "project.project" + _parent_store = True + _parent_name = "parent_id" + + parent_id = fields.Many2one( + comodel_name="project.project", string="Parent Project", index=True + ) + child_ids = fields.One2many( + comodel_name="project.project", inverse_name="parent_id", string="Sub-projects" + ) + + parent_path = fields.Char(index="btree") + + child_ids_count = fields.Integer(compute="_compute_child_ids_count", store=True) + + @api.depends("child_ids") + def _compute_child_ids_count(self): + for project in self: + project.child_ids_count = len(project.child_ids) + + def action_open_child_project(self): + self.ensure_one() + ctx = self.env.context.copy() + ctx.update(default_parent_id=self.id) + domain = [("parent_id", "=", self.id)] + return { + "type": "ir.actions.act_window", + "view_type": "form", + "name": f"Children of {self.name}", + "view_mode": "list,form,graph", + "res_model": "project.project", + "target": "current", + "context": ctx, + "domain": domain, + } diff --git a/project_parent/pyproject.toml b/project_parent/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/project_parent/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/project_parent/readme/CONTRIBUTORS.md b/project_parent/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..bf7feff544 --- /dev/null +++ b/project_parent/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Eric Caudal \<\> +- Giovanni Francesco Capalbo \<\> +- Thomas Fossoul \<\> +- `Heliconia Solutions Pvt. Ltd. `_ diff --git a/project_parent/readme/DESCRIPTION.md b/project_parent/readme/DESCRIPTION.md new file mode 100644 index 0000000000..2c34aa0044 --- /dev/null +++ b/project_parent/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module introduces project parent and childs fields. diff --git a/project_parent/readme/USAGE.md b/project_parent/readme/USAGE.md new file mode 100644 index 0000000000..9da675cb88 --- /dev/null +++ b/project_parent/readme/USAGE.md @@ -0,0 +1,15 @@ +In Kanban View: + +1. Go to Project \> Dashboard +2. Group by "Parent Project" + +In Tree View: + +1. Go to Project \>Configuration \> Projects +2. Group by "Parent Project" + +In form View: + +1. Go to Project \> Dashboard +2. Open the projects settings +3. Modify the "Parent Project" in settings tab diff --git a/project_parent/static/description/icon.png b/project_parent/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/project_parent/static/description/icon.png differ diff --git a/project_parent/static/description/index.html b/project_parent/static/description/index.html new file mode 100644 index 0000000000..e92d7e4e17 --- /dev/null +++ b/project_parent/static/description/index.html @@ -0,0 +1,447 @@ + + + + + +Project Parent + + + +
+

Project Parent

+ + +

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

+

This module introduces project parent and childs fields.

+

Table of contents

+ +
+

Usage

+

In Kanban View:

+
    +
  1. Go to Project > Dashboard
  2. +
  3. Group by “Parent Project”
  4. +
+

In Tree View:

+
    +
  1. Go to Project >Configuration > Projects
  2. +
  3. Group by “Parent Project”
  4. +
+

In form View:

+
    +
  1. Go to Project > Dashboard
  2. +
  3. Open the projects settings
  4. +
  5. Modify the “Parent Project” in settings tab
  6. +
+
+
+

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

+
    +
  • Therp B.V.
  • +
  • Elico Corp
  • +
+
+
+

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_parent/tests/__init__.py b/project_parent/tests/__init__.py new file mode 100644 index 0000000000..5e3456788a --- /dev/null +++ b/project_parent/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_project_parent diff --git a/project_parent/tests/test_project_parent.py b/project_parent/tests/test_project_parent.py new file mode 100644 index 0000000000..0239234233 --- /dev/null +++ b/project_parent/tests/test_project_parent.py @@ -0,0 +1,28 @@ +# Copyright 2020 haulogy SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestProjectParent(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.project_project_1 = cls.env.ref("project.project_project_1") + cls.project_project_2 = cls.env.ref("project.project_project_2") + cls.project_project_3 = cls.env["project.project"].create( + {"name": "TestProject", "parent_id": cls.project_project_1.id} + ) + + def test_parent_childs_project(self): + self.assertIn(self.project_project_2, self.project_project_1.child_ids) + self.assertIn(self.project_project_3, self.project_project_1.child_ids) + + def test_action_open_child_project(self): + res = self.project_project_1.action_open_child_project() + self.assertEqual( + res.get("domain"), [("parent_id", "=", self.project_project_1.id)] + ) + self.assertEqual( + res.get("context").get("default_parent_id"), self.project_project_1.id + ) diff --git a/project_parent/views/project_parent_views.xml b/project_parent/views/project_parent_views.xml new file mode 100644 index 0000000000..5adc4507d6 --- /dev/null +++ b/project_parent/views/project_parent_views.xml @@ -0,0 +1,77 @@ + + + + + project.project.form + project.project + + + + + +
+ +
+
+
+ + project.project.tree + project.project + + + + + + + + + project.project.kanban.inherited + project.project + + + + + + +
+ + + +
+
+
+
+ + project.project.filter + project.project + + search + + + + + + + + + +