-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
66
project_task_deadline_from_project/tests/test_project_task.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Binary file added
BIN
+180 KB
project_task_editable_list_view/static/description/editable_fields.png
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
project_task_editable_list_view/views/project_task_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
Oops, something went wrong.