Skip to content

Commit

Permalink
Merge branch '16.0' into TA#TA#67341_patch2
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda authored Jan 30, 2025
2 parents a1470c0 + 02ba2f5 commit 380f2ba
Show file tree
Hide file tree
Showing 26 changed files with 197 additions and 28 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"project_milestone_time_kpi",
"project_no_quick_create",
"project_parent_enhanced",
"project_parent_type_required",
"project_portal_hide_timesheets",
"project_progress_variance",
"project_projected_hours",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ COPY project_milestone_spent_hours /mnt/extra-addons/project_milestone_spent_hou
COPY project_milestone_time_kpi /mnt/extra-addons/project_milestone_time_kpi
COPY project_no_quick_create /mnt/extra-addons/project_no_quick_create
COPY project_parent_enhanced mnt/extra-addons/project_parent_enhanced
COPY project_parent_type_required mnt/extra-addons/project_parent_type_required
COPY project_portal_hide_timesheets mnt/extra-addons/project_portal_hide_timesheets
COPY project_progress_variance /mnt/extra-addons/project_progress_variance
COPY project_projected_hours mnt/extra-addons/project_projected_hours
Expand Down
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
30 changes: 30 additions & 0 deletions project_parent_type_required/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Project Parent Type Required
============================

This modules allows to drive the require of parent in project from the project type.

by checking the boolean Is Parent Required, all the project of this type must have a parent set.

when I go to the project types, I see a new checkbox

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

After having set up the types, I can see the effect on project

If the type requires a parent project

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

Otherwise

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

Contributors
------------
- Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More Information
----------------
For more details, visit:
- https://github.com/OCA/project/tree/16.0/project_parent

4 changes: 4 additions & 0 deletions project_parent_type_required/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
19 changes: 19 additions & 0 deletions project_parent_type_required/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Project Parent Required by Type",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "LGPL-3",
"category": "Project",
"summary": "Allow to tag projet types to force to have project parent.",
"depends": ["project_parent", "project_type"],
"data": [
"views/project_project_views.xml",
"views/project_type_views.xml",
],
"installable": True,
}
32 changes: 32 additions & 0 deletions project_parent_type_required/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_parent_type_required
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-29 08:32+0000\n"
"PO-Revision-Date: 2025-01-29 08:32+0000\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_type_required
#: model:ir.model.fields,field_description:project_parent_type_required.field_project_project__is_parent_required
#: model:ir.model.fields,field_description:project_parent_type_required.field_project_type__is_project_parent_required
msgid "Is project parent required"
msgstr "Projet parent requis"

#. module: project_parent_type_required
#: model:ir.model,name:project_parent_type_required.model_project_project
msgid "Project"
msgstr "Projet"

#. module: project_parent_type_required
#: model:ir.model,name:project_parent_type_required.model_project_type
msgid "Project Type"
msgstr "Type de projet"
5 changes: 5 additions & 0 deletions project_parent_type_required/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import project_type
from . import project_project
11 changes: 11 additions & 0 deletions project_parent_type_required/models/project_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import models, fields


class Project(models.Model):
_inherit = "project.project"

is_parent_required = fields.Boolean(related="type_id.is_project_parent_required")
11 changes: 11 additions & 0 deletions project_parent_type_required/models/project_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import models, fields


class ProjectType(models.Model):
_inherit = "project.type"

is_project_parent_required = fields.Boolean(string="Is project parent required")
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.
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.
18 changes: 18 additions & 0 deletions project_parent_type_required/views/project_project_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="edit_project" model="ir.ui.view">
<field name="name">Project Form With Parent: Required</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="before">
<field name="is_parent_required" invisible="1" />
</field>
<field name="parent_id" position="attributes">
<attribute name="attrs">{'required':[('is_parent_required', '=', True)]}</attribute>
</field>
</field>
</record>

</odoo>
18 changes: 18 additions & 0 deletions project_parent_type_required/views/project_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="project_type_form" model="ir.ui.view">
<field name="name">Project Type: Is Parent Required</field>
<field name="model">project.type</field>
<field name="inherit_id" ref="project_type.project_type_form" />
<field name="arch" type="xml">
<xpath expr="//div[field[@name='task_ok']]" position="after">
<div>
<field name="is_project_parent_required" />
<label for="is_project_parent_required" />
</div>
</xpath>
</field>
</record>

</odoo>
6 changes: 5 additions & 1 deletion project_time_range/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"category": "Project",
"summary": "Add fields Min and Max on project tasks.",
"depends": ["hr_timesheet"],
"data": ["views/portal.xml", "views/project_task.xml", "views/project_project.xml"],
"data": [
"views/project_task_portal_template.xml",
"views/project_task_views.xml",
"views/project_project_views.xml",
],
"installable": True,
}
5 changes: 2 additions & 3 deletions project_time_range/models/project_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import fields, models, api, _
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError

from .util import time_range_constraint


Expand All @@ -22,12 +23,10 @@ class ProjectTask(models.Model):
"Sub-tasks Max", compute="_compute_subtask_max_hours"
)

@api.depends("child_ids.min_hours")
def _compute_subtask_min_hours(self):
for task in self:
task.subtask_min_hours = sum(task.child_ids.mapped("min_hours"))

@api.depends("child_ids.max_hours")
def _compute_subtask_max_hours(self):
for task in self:
task.subtask_max_hours = sum(task.child_ids.mapped("max_hours"))
Expand Down
Binary file modified project_time_range/static/description/portal_task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<page name="management" string="Management">
<group>
<group name="time_range" string="Time Range">
<field name="min_hours" string="Min" widget="float_time" />
<field name="planned_hours" string="Ideal" widget="float_time" />
<field name="max_hours" string="Max" widget="float_time" />
<field name="consumed_hours" string="Spent" widget="float_time" />
<field name="remaining_hours" string="Remaining" widget="float_time" />
<field name="min_hours" string="Min" widget="timesheet_uom_no_toggle" />
<field name="planned_hours" string="Ideal" widget="timesheet_uom_no_toggle" />
<field name="max_hours" string="Max" widget="timesheet_uom_no_toggle" />
<field name="consumed_hours" string="Spent" widget="timesheet_uom_no_toggle" />
<field name="remaining_hours" string="Remaining" widget="timesheet_uom_no_toggle" />
</group>
</group>
</page>
Expand All @@ -28,11 +28,11 @@
<field name="inherit_id" ref="project.view_project" />
<field name="arch" type="xml">
<tree position="inside">
<field name="min_hours" string="Min" sum="Min" widget="float_time" />
<field name="planned_hours" string="Ideal" sum="Ideal" widget="float_time" />
<field name="max_hours" string="Max" sum="Max" widget="float_time" />
<field name="consumed_hours" string="Spent" widget="float_time" />
<field name="remaining_hours" string="Remaining" widget="float_time" />
<field name="min_hours" string="Min" sum="Min" widget="timesheet_uom_no_toggle" />
<field name="planned_hours" string="Ideal" sum="Ideal" widget="timesheet_uom_no_toggle" />
<field name="max_hours" string="Max" sum="Max" widget="timesheet_uom_no_toggle" />
<field name="consumed_hours" string="Spent" widget="timesheet_uom_no_toggle" />
<field name="remaining_hours" string="Remaining" widget="timesheet_uom_no_toggle" />
</tree>
</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<div class="mb8">
<div>
<strong>Min:</strong>
<span t-field="task.min_hours" t-field-options="{'widget': 'float_time'}" t-if="task.min_hours" />
<span t-field="task.min_hours" t-options="{'widget': 'float_time'}" t-if="task.min_hours" />
</div>
<div>
<strong>Ideal:</strong>
<span t-field="task.planned_hours" t-field-options="{'widget': 'float_time'}"
<span t-field="task.planned_hours" t-options="{'widget': 'float_time'}"
t-if="task.planned_hours" />
</div>
<div>
<strong>Max:</strong>
<span t-field="task.max_hours" t-field-options="{'widget': 'float_time'}" t-if="task.max_hours" />
<span t-field="task.max_hours" t-options="{'widget': 'float_time'}" t-if="task.max_hours" />
</div>
</div>
</xpath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
<field name="inherit_id" ref="hr_timesheet.view_task_tree2_inherited" />
<field name="arch" type="xml">
<field name="planned_hours" position="before">
<field name="min_hours" string="Min" widget="float_time" sum="Min" />
<field name="min_hours" string="Min" widget="timesheet_uom_no_toggle" sum="Min" />
</field>
<field name="planned_hours" position="attributes">
<attribute name="string">Ideal</attribute>
<attribute name="sum">Ideal</attribute>
<attribute name="optional">show</attribute>
</field>
<field name="planned_hours" position="after">
<field name="max_hours" string="Max" widget="float_time" sum="Max" />
<field name="max_hours" string="Max" widget="timesheet_uom_no_toggle" sum="Max" />
</field>
</field>
</record>
Expand Down

0 comments on commit 380f2ba

Please sign in to comment.