Skip to content

Commit 02ba2f5

Browse files
rivo2302lanto-razafindrabemajouda
authored
TA#72160 [16.0] [IMP] project_parent_enhanced : code from project_iteration_parent_only (#508)
--------- Co-authored-by: Lanto R. <[email protected]> Co-authored-by: Majda EL MARIOULI <[email protected]>
1 parent 1114532 commit 02ba2f5

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

project_parent_enhanced/README.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,34 @@ Features
2323
**Tasks Group by Parent Projects**
2424
- Add a new group option to group tasks by their parent projects.
2525

26-
.. image:: static/description/task_group_by_parent.png
26+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/task_group_by_parent.png
2727

2828
** Search and Filter Project by Parent Projects**
2929

3030
- Add a new search filter to search projects by their parent projects.
3131

32-
.. image:: static/description/search_project_by_parent.png
32+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/search_project_by_parent.png
3333

3434
- The filter by parent project is also available
3535

36-
.. image:: static/description/filter_project_by_parent_project.png
36+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/filter_project_by_parent_project.png
3737

3838
**View Adjustments**
3939
- Replace project names with their `display_name` to show the hierarchy in views.
4040

4141
In the Kanban view:
4242

43-
.. image:: static/description/iteration_name_kanban_view.png
43+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/iteration_name_kanban_view.png
4444

4545
In the List view:
4646

47-
.. image:: static/description/iteration_name_list_view.png
47+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/iteration_name_list_view.png
4848

49+
- Add a filter on the `parent_id` field in the project form view to display only parent projects.
50+
51+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/project_list.png
52+
53+
.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/project_view_form.png
4954

5055
Contributors
5156
------------

project_parent_enhanced/models/project_project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ class ProjectProject(models.Model):
99

1010
_inherit = "project.project"
1111

12+
is_parent = fields.Boolean(
13+
"Is Parent", compute="_compute_is_parent", store=True, compute_sudo=True
14+
)
15+
1216
@api.depends("child_ids")
1317
def _compute_is_parent(self):
1418
for project in self:
@@ -70,10 +74,6 @@ def name_get(self):
7074
res.extend((p.id, ", ".join([p.parent_id.name, p.name])) for p in iterations)
7175
return res
7276

73-
is_parent = fields.Boolean(
74-
"Is Parent", compute="_compute_is_parent", store=True, compute_sudo=True
75-
)
76-
7777
def _propagate_followers_from_parent(self):
7878
self.message_unsubscribe(self.message_partner_ids.ids)
7979
self.message_subscribe(self.parent_id.message_partner_ids.ids)
88.2 KB
Loading
80.6 KB
Loading

project_parent_enhanced/views/project_project_views.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
33

4+
<record id="edit_project_parent_projet_only" model="ir.ui.view">
5+
<field name="name">Project Form With Parent Only</field>
6+
<field name="model">project.project</field>
7+
<field name="inherit_id" ref="project_parent.edit_project"/>
8+
<field name="arch" type="xml">
9+
<field name="parent_id" position="attributes">
10+
<attribute name="domain">[("parent_id", "=", False)]</attribute>
11+
</field>
12+
</field>
13+
</record>
14+
415
<record id="view_project_project_filter" model="ir.ui.view">
516
<field name="name">Project Search With Parent Project</field>
617
<field name="model">project.project</field>

0 commit comments

Comments
 (0)