Skip to content

Commit 82db9d7

Browse files
committed
Merge PR #1449 into 18.0
Signed-off-by pedrobaeza
2 parents fdaddf1 + a74b108 commit 82db9d7

16 files changed

+755
-0
lines changed

project_tag_hierarchy/README.rst

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
=====================
2+
Project Tag Hierarchy
3+
=====================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:5fb078d69248b36ffe14542494ea9ede7cf8c521fc5ea432189cf7a00d697cf3
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
20+
:target: https://github.com/OCA/project/tree/18.0/project_tag_hierarchy
21+
:alt: OCA/project
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_tag_hierarchy
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Hierarchy is added to the project labels.
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Bug Tracker
39+
===========
40+
41+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
42+
In case of trouble, please check there if your issue has already been reported.
43+
If you spotted it first, help us to smash it by providing a detailed and welcomed
44+
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_tag_hierarchy%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
45+
46+
Do not contact contributors directly about support or help with technical issues.
47+
48+
Credits
49+
=======
50+
51+
Authors
52+
-------
53+
54+
* Tecnativa
55+
56+
Contributors
57+
------------
58+
59+
- `Tecnativa <https://www.tecnativa.com>`__:
60+
61+
- Víctor Martínez
62+
- Pedro M. Baeza
63+
64+
Maintainers
65+
-----------
66+
67+
This module is maintained by the OCA.
68+
69+
.. image:: https://odoo-community.org/logo.png
70+
:alt: Odoo Community Association
71+
:target: https://odoo-community.org
72+
73+
OCA, or the Odoo Community Association, is a nonprofit organization whose
74+
mission is to support the collaborative development of Odoo features and
75+
promote its widespread use.
76+
77+
.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
78+
:target: https://github.com/victoralmau
79+
:alt: victoralmau
80+
81+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
82+
83+
|maintainer-victoralmau|
84+
85+
This module is part of the `OCA/project <https://github.com/OCA/project/tree/18.0/project_tag_hierarchy>`_ project on GitHub.
86+
87+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

project_tag_hierarchy/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

project_tag_hierarchy/__manifest__.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2024 Tecnativa - Víctor Martínez
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Project Tag Hierarchy",
5+
"version": "18.0.1.0.0",
6+
"category": "Project Management",
7+
"website": "https://github.com/OCA/project",
8+
"author": "Tecnativa, Odoo Community Association (OCA)",
9+
"license": "AGPL-3",
10+
"depends": ["project"],
11+
"installable": True,
12+
"auto_install": True,
13+
"data": [
14+
"views/project_tags_views.xml",
15+
],
16+
"maintainers": ["victoralmau"],
17+
}

project_tag_hierarchy/i18n/es.po

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_tag_hierarchy
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-10-11 11:32+0000\n"
10+
"PO-Revision-Date: 2024-10-11 13:33+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: \n"
18+
"X-Generator: Poedit 3.0.1\n"
19+
20+
#. module: project_tag_hierarchy
21+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__child_ids
22+
msgid "Child Tags"
23+
msgstr "Etiquetas hijas"
24+
25+
#. module: project_tag_hierarchy
26+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_path
27+
msgid "Parent Path"
28+
msgstr "Ruta padre"
29+
30+
#. module: project_tag_hierarchy
31+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_id
32+
msgid "Parent Tag"
33+
msgstr "Etiqueta padre"
34+
35+
#. module: project_tag_hierarchy
36+
#: model:ir.model,name:project_tag_hierarchy.model_project_tags
37+
msgid "Project Tags"
38+
msgstr "Etiquetas del proyecto"
39+
40+
#. module: project_tag_hierarchy
41+
#. odoo-python
42+
#: code:addons/project_tag_hierarchy/models/project_tags.py:0
43+
#, python-format
44+
msgid "You can not create recursive tags."
45+
msgstr "No puede crear etiquetas recursivas."

project_tag_hierarchy/i18n/it.po

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_tag_hierarchy
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2024-10-21 10:06+0000\n"
10+
"Last-Translator: mymage <[email protected]>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.6.2\n"
18+
19+
#. module: project_tag_hierarchy
20+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__child_ids
21+
msgid "Child Tags"
22+
msgstr "Etichette figlie"
23+
24+
#. module: project_tag_hierarchy
25+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_path
26+
msgid "Parent Path"
27+
msgstr "Percorso padre"
28+
29+
#. module: project_tag_hierarchy
30+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_id
31+
msgid "Parent Tag"
32+
msgstr "Etichetta padre"
33+
34+
#. module: project_tag_hierarchy
35+
#: model:ir.model,name:project_tag_hierarchy.model_project_tags
36+
msgid "Project Tags"
37+
msgstr "Etichette progetto"
38+
39+
#. module: project_tag_hierarchy
40+
#. odoo-python
41+
#: code:addons/project_tag_hierarchy/models/project_tags.py:0
42+
#, python-format
43+
msgid "You can not create recursive tags."
44+
msgstr "Non si possono creare etichette ricorsive."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_tag_hierarchy
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: project_tag_hierarchy
17+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__child_ids
18+
msgid "Child Tags"
19+
msgstr ""
20+
21+
#. module: project_tag_hierarchy
22+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_path
23+
msgid "Parent Path"
24+
msgstr ""
25+
26+
#. module: project_tag_hierarchy
27+
#: model:ir.model.fields,field_description:project_tag_hierarchy.field_project_tags__parent_id
28+
msgid "Parent Tag"
29+
msgstr ""
30+
31+
#. module: project_tag_hierarchy
32+
#: model:ir.model,name:project_tag_hierarchy.model_project_tags
33+
msgid "Project Tags"
34+
msgstr ""
35+
36+
#. module: project_tag_hierarchy
37+
#. odoo-python
38+
#: code:addons/project_tag_hierarchy/models/project_tags.py:0
39+
#, python-format
40+
msgid "You can not create recursive tags."
41+
msgstr ""
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import project_tags
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2024-2025 Tecnativa - Víctor Martínez
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
3+
from odoo import _, api, fields, models
4+
from odoo.exceptions import ValidationError
5+
6+
7+
class ProjectTags(models.Model):
8+
_inherit = "project.tags"
9+
_parent_store = True
10+
11+
parent_id = fields.Many2one(
12+
comodel_name="project.tags", string="Parent Tag", index=True, ondelete="cascade"
13+
)
14+
child_ids = fields.One2many(
15+
comodel_name="project.tags", inverse_name="parent_id", string="Child Tags"
16+
)
17+
parent_path = fields.Char(index=True)
18+
19+
@api.depends("name", "parent_id")
20+
def _compute_display_name(self):
21+
for tag in self:
22+
names = []
23+
current = tag
24+
while current:
25+
names.append(current.name)
26+
current = current.parent_id
27+
tag.display_name = " / ".join(reversed(names))
28+
29+
@api.constrains("parent_id")
30+
def _check_parent_id(self):
31+
if self._has_cycle():
32+
raise ValidationError(_("You can not create recursive tags."))

project_tag_hierarchy/pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [Tecnativa](https://www.tecnativa.com):
2+
- Víctor Martínez
3+
- Pedro M. Baeza
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hierarchy is added to the project labels.
Loading

0 commit comments

Comments
 (0)