Skip to content

Commit

Permalink
TA#72160 [16.0] [IMP] project_parent_enhanced : code from project_ite…
Browse files Browse the repository at this point in the history
…ration_parent_only (#508)


---------

Co-authored-by: Lanto R. <124650562+lanto-razafindrabe@users.noreply.github.com>
Co-authored-by: Majda EL MARIOULI <majdaelmariouli@gmail.com>
  • Loading branch information
3 people authored Jan 30, 2025
1 parent 1114532 commit 02ba2f5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
15 changes: 10 additions & 5 deletions project_parent_enhanced/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,34 @@ Features
**Tasks Group by Parent Projects**
- Add a new group option to group tasks by their parent projects.

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

** Search and Filter Project by Parent Projects**

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

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

- The filter by parent project is also available

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

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

In the Kanban view:

.. image:: static/description/iteration_name_kanban_view.png
.. 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

In the List view:

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

- Add a filter on the `parent_id` field in the project form view to display only parent projects.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/project_list.png

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_parent_enhanced/static/description/project_view_form.png

Contributors
------------
Expand Down
8 changes: 4 additions & 4 deletions project_parent_enhanced/models/project_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class ProjectProject(models.Model):

_inherit = "project.project"

is_parent = fields.Boolean(
"Is Parent", compute="_compute_is_parent", store=True, compute_sudo=True
)

@api.depends("child_ids")
def _compute_is_parent(self):
for project in self:
Expand Down Expand Up @@ -70,10 +74,6 @@ def name_get(self):
res.extend((p.id, ", ".join([p.parent_id.name, p.name])) for p in iterations)
return res

is_parent = fields.Boolean(
"Is Parent", compute="_compute_is_parent", store=True, compute_sudo=True
)

def _propagate_followers_from_parent(self):
self.message_unsubscribe(self.message_partner_ids.ids)
self.message_subscribe(self.parent_id.message_partner_ids.ids)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions project_parent_enhanced/views/project_project_views.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="edit_project_parent_projet_only" model="ir.ui.view">
<field name="name">Project Form With Parent Only</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project_parent.edit_project"/>
<field name="arch" type="xml">
<field name="parent_id" position="attributes">
<attribute name="domain">[("parent_id", "=", False)]</attribute>
</field>
</field>
</record>

<record id="view_project_project_filter" model="ir.ui.view">
<field name="name">Project Search With Parent Project</field>
<field name="model">project.project</field>
Expand Down

0 comments on commit 02ba2f5

Please sign in to comment.