Skip to content

Commit

Permalink
Merge branch '16.0' into TA#72157
Browse files Browse the repository at this point in the history
  • Loading branch information
abenzbiria authored Dec 10, 2024
2 parents 6199585 + f58c6e8 commit 4981f82
Show file tree
Hide file tree
Showing 40 changed files with 793 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"depends": [
"project",
"project_task_date_planned",
"project_task_deadline_from_project",
"project_task_editable_list_view",
"project_task_full_text_search",
"project_track_end_date",
"project_type_advanced",
"project_default_task_stage",
"project_parent_enhanced",
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ USER odoo
COPY project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet
COPY project_parent_enhanced mnt/extra-addons/project_parent_enhanced
COPY project_task_date_planned /mnt/extra-addons/project_task_date_planned
COPY project_task_deadline_from_project /mnt/extra-addons/project_task_deadline_from_project
COPY project_task_editable_list_view /mnt/extra-addons/project_task_editable_list_view
COPY project_task_full_text_search /mnt/extra-addons/project_task_full_text_search
COPY project_track_end_date /mnt/extra-addons/project_track_end_date
COPY project_type_advanced /mnt/extra-addons/project_type_advanced
COPY project_default_task_stage /mnt/extra-addons/project_default_task_stage

Expand Down
2 changes: 2 additions & 0 deletions gitoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
branch: "16.0"
includes:
- project_task_dependency
- project_timeline
- project_timesheet_time_control
- project_type
- project_parent
Expand All @@ -21,3 +22,4 @@
branch: "16.0"
includes:
- web_ir_actions_act_multi
- web_timeline
13 changes: 13 additions & 0 deletions project_task_deadline_from_project/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Project Task Deadline From Project
==================================
This module automatically sets the deadline on a task from the project's deadline.

When changing the task from one project to another, the deadline is automatically changed.

If the destination project has no deadline, then, the deadline on the task is emptied.

The deadline on a task can always be changed manually.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
4 changes: 4 additions & 0 deletions project_task_deadline_from_project/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2018-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
15 changes: 15 additions & 0 deletions project_task_deadline_from_project/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2018-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 Task Deadline From Project",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "LGPL-3",
"category": "Project",
"summary": "Propagate the deadline from projects to tasks.",
"depends": ["project"],
"installable": True,
}
4 changes: 4 additions & 0 deletions project_task_deadline_from_project/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2018-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_task
29 changes: 29 additions & 0 deletions project_task_deadline_from_project/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2018-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 api, models


class ProjectTaskWithDeadlineFromProject(models.Model):
_inherit = "project.task"

@api.model
def create(self, vals):
task = super().create(vals)
should_propagate_deadline = task.project_id and "date_deadline" not in vals
if should_propagate_deadline:
task.date_deadline = task.project_id.date
return task

def write(self, vals):
should_propagate_deadline = (
vals.get("project_id") and "date_deadline" not in vals
)
if should_propagate_deadline:
project = self.env["project.project"].browse(vals["project_id"])
vals["date_deadline"] = project.date
return super().write(vals)

@api.onchange("project_id")
def _onchange_project_propagate_deadline(self):
self.date_deadline = self.project_id.date
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions project_task_deadline_from_project/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2018-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 test_project_task
66 changes: 66 additions & 0 deletions project_task_deadline_from_project/tests/test_project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2018-today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from datetime import date
from odoo.tests.common import TransactionCase


class TestProjectTask(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.deadline = date(2018, 6, 1)
cls.project_with_no_deadline = cls.env["project.project"].create(
{
"name": "Project With No Deadline",
"date": False,
}
)
cls.project_with_deadline = cls.env["project.project"].create(
{
"name": "Project With Deadline",
"date": cls.deadline,
}
)
cls.task = cls.env["project.task"].create({"name": "Task 1"})

def test_when_creating_task_with_project_then_deadline_is_propagated(self):
task = self.env["project.task"].create(
{
"name": "Task 2",
"project_id": self.project_with_deadline.id,
}
)
self.assertEqual(task.date_deadline, self.deadline)

def test_when_creating_task_with_default_project_then_deadline_is_propagated(self):
task = (
self.env["project.task"]
.with_context(default_project_id=self.project_with_deadline.id)
.create({"name": "Task 2"})
)
self.assertEqual(task.date_deadline, self.deadline)

def test_when_creating_task_if_project_has_no_deadline_then_deadline_is_empty(self):
task = self.env["project.task"].create(
{
"name": "Task 2",
"project_id": self.project_with_no_deadline.id,
}
)
self.assertFalse(task.date_deadline)

def test_when_changing_project_then_deadline_is_propagated(self):
self.task.project_id = self.project_with_deadline
self.assertEqual(self.task.date_deadline, self.deadline)

def test_when_changing_project_if_project_has_no_deadline_then_deadline_is_empty(
self,
):
self.task.project_id = self.project_with_no_deadline
self.assertFalse(self.task.date_deadline)

def test_onchange_project_then_deadline_is_propagated_to_task(self):
self.task.project_id = self.project_with_deadline
self.task._onchange_project_propagate_deadline()
self.assertEqual(self.task.date_deadline, self.deadline)
16 changes: 16 additions & 0 deletions project_task_editable_list_view/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Project Task Editable List View
===============================

This module adds an editable list view of tasks.

.. image:: static/description/menu.png

The fields ``Assigned To``, ``Date Planned`` and ``Planned Hours`` are editable.

The field ``Project`` is readonly.

.. image:: static/description/editable_fields.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
2 changes: 2 additions & 0 deletions project_task_editable_list_view/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
16 changes: 16 additions & 0 deletions project_task_editable_list_view/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2021 - 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 Task Editable List",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "LGPL-3",
"category": "Project",
"summary": "Add an editable list view of tasks",
"depends": ["project_task_date_planned"],
"data": ["views/project_task_views.xml", "views/menu_items.xml"],
"installable": True,
}
32 changes: 32 additions & 0 deletions project_task_editable_list_view/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_task_editable_list_view
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 05:44+0000\n"
"PO-Revision-Date: 2024-11-28 05:44+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_task_editable_list_view
#: model:ir.ui.menu,name:project_task_editable_list_view.search_menu
msgid "Search"
msgstr "Recherche"

#. module: project_task_editable_list_view
#: model:ir.actions.act_window,name:project_task_editable_list_view.editable_task_list_action
#: model_terms:ir.ui.view,arch_db:project_task_editable_list_view.editable_task_list_view
msgid "Tasks"
msgstr "Tâches"

#. module: project_task_editable_list_view
#: model:ir.ui.menu,name:project_task_editable_list_view.editable_task_list_menu
msgid "Tasks (Editable List)"
msgstr "Tâches en vue liste"
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.
23 changes: 23 additions & 0 deletions project_task_editable_list_view/views/menu_items.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="search_menu" model="ir.ui.menu">
<field name="name">Search</field>
<field name="parent_id" ref="project.menu_main_pm"/>
<field name="sequence">2</field>
</record>

<record id="project.menu_project_management" model="ir.ui.menu">
<field name="name">Tasks</field>
<field name="parent_id" ref="search_menu"/>
<field name="sequence">1</field>
</record>

<record id="editable_task_list_menu" model="ir.ui.menu">
<field name="name">Tasks (Editable List)</field>
<field name="parent_id" ref="search_menu"/>
<field name="action" ref="editable_task_list_action"/>
<field name="sequence">2</field>
</record>

</odoo>
26 changes: 26 additions & 0 deletions project_task_editable_list_view/views/project_task_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="editable_task_list_view" model="ir.ui.view">
<field name="name">Task Editable List View</field>
<field name="model">project.task</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<tree string="Tasks" editable="top">
<field name="display_name"/>
<field name="project_id" readonly="1"/>
<field name="user_ids"/>
<field name="date_planned"/>
<field name="planned_hours"/>
</tree>
</field>
</record>

<record id="editable_task_list_action" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">project.task</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="editable_task_list_view"/>
</record>

</odoo>
34 changes: 34 additions & 0 deletions project_track_end_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Project Track End Date
======================
This module gives the possibility to trace the expiration date changes of each project.

Usage
-----
***UPDATE OF EXPIRATION DATE***
Changing the expiry date must be done by clicking on the `Edit Expiration Date` button:

.. image:: static/description/edit_end_date_button.png

The `Expiration Date` is now readonly and can only be modified using the new button.

A popup wizard will open :

.. image:: static/description/wizard_for_end_date_update.png

This modification is listed among others in the following list.
The list is accessible from the smart button:

.. image:: static/description/project_end_date_historics.png

.. image:: static/description/project_end_date_historic_lines.png

***EXPECTED DURATION OF A PROJECT***

I can also see that under the `Expiration Date` of project, in a view form, there is a new field `Expected Duration (in Weeks)`.
This field is calculated and updated each time the expiration date is revised, this makes it easy to use the number of weeks on the project.

.. image:: static/description/expected_week_duration.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
5 changes: 5 additions & 0 deletions project_track_end_date/__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 AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

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

{
"name": "Project Track End Date",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"category": "Project",
"description": "Track project expiration date changes",
"summary": """
Gives the possibility to trace the changes in the end of
validity date of each project/Milestone.
""",
"depends": ["project_timeline"],
"data": [
"security/ir.model.access.csv",
"views/project_project.xml",
"wizard/edit_date_wizard_views.xml",
],
"installable": True,
}
Loading

0 comments on commit 4981f82

Please sign in to comment.