-
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.
TA#72208 [16.0][MIG] project_track_end_date (#463)
* TA#72208 [16.0][MIG] project_track_end_date * [IMP] Code improvement * [16.0][MIG] project_track_end_date --------- Co-authored-by: Abdellatif Benzbiria <[email protected]>
- Loading branch information
1 parent
80ad5b5
commit f58c6e8
Showing
23 changed files
with
539 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,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, | ||
} |
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,169 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_track_end_date | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-02-05 07:16+0000\n" | ||
"PO-Revision-Date: 2024-02-05 07:16+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_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__user_id | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__user_id | ||
msgid "Author" | ||
msgstr "Utilisateur" | ||
|
||
#. module: project_track_end_date | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard | ||
msgid "Cancel" | ||
msgstr "Annuler" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__company_id | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__company_id | ||
msgid "Company" | ||
msgstr "Société" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__create_uid | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__create_uid | ||
msgid "Created by" | ||
msgstr "Créé par" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__create_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__create_date | ||
msgid "Created on" | ||
msgstr "Créé le" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__date | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard | ||
msgid "Date" | ||
msgstr "Date" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__display_name | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__display_name | ||
msgid "Display Name" | ||
msgstr "Nom affiché" | ||
|
||
#. module: project_track_end_date | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard | ||
msgid "Edit Date" | ||
msgstr "Modifier la date" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.actions.act_window,name:project_track_end_date.wizard_edit_end_date | ||
msgid "Edit Date Action" | ||
msgstr "Modifier la date" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model,name:project_track_end_date.model_edit_date_wizard | ||
msgid "Edit Date Wizard" | ||
msgstr "Wizard de modification de la date" | ||
|
||
#. module: project_track_end_date | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.project_form_readonly_end_date | ||
msgid "Edit End Date" | ||
msgstr "Modifier la date de fin" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.actions.act_window,name:project_track_end_date.action_view_project_end_history | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__project_end_history_count | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.ir_actions_project_end_history_tree | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.project_form_with_edit_end_date | ||
msgid "End Date Changes Historics" | ||
msgstr "Historiques des dates de fin de projet" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__expected_week_duration | ||
msgid "Expected Duration (in Weeks)" | ||
msgstr "Durée prévue (en semaine)" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__date | ||
msgid "End Date" | ||
msgstr "Date de fin" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__project_end_history_ids | ||
msgid "Historics Associated to this Project" | ||
msgstr "Historique associée au projet" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__id | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__initial_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__initial_date | ||
msgid "Initial Date" | ||
msgstr "Date initiale de fin de validité" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard____last_update | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière Modification le" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__write_uid | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__write_uid | ||
msgid "Last Updated by" | ||
msgstr "Dernière mise à jour par" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__write_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__write_date | ||
msgid "Last Updated on" | ||
msgstr "Dernière mise à jour le" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__week_interval_date | ||
msgid "Number of Reporting Weeks" | ||
msgstr "Nombre de semaine de report" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model,name:project_track_end_date.model_project_project | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__project_id | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__project_id | ||
msgid "Project" | ||
msgstr "Projet" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model,name:project_track_end_date.model_project_end_history | ||
msgid "Project End History" | ||
msgstr "Historique d'échéance de projet" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__reason | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__reason | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard | ||
msgid "Reason" | ||
msgstr "Motif de modification" | ||
|
||
#. module: project_track_end_date | ||
#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard | ||
msgid "Save" | ||
msgstr "Mettre à jour" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__total_week_duration | ||
msgid "Total Project Duration (Weeks)" | ||
msgstr "Durée totale du projet (semaines)" | ||
|
||
#. module: project_track_end_date | ||
#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__update_on | ||
msgid "Update on" | ||
msgstr "Mis à jour le" |
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,7 @@ | ||
# 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). | ||
|
||
from . import ( | ||
project_project, | ||
project_end_history, | ||
) |
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,19 @@ | ||
# 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). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProjectEndHistory(models.Model): | ||
_name = "project.end.history" | ||
_description = "Project End History" | ||
|
||
update_on = fields.Datetime(string="Update on") | ||
initial_date = fields.Date(string="Initial Date") | ||
date = fields.Date(string="Date") | ||
week_interval_date = fields.Float(string="Number of Reporting Weeks") | ||
total_week_duration = fields.Float(string="Total Project Duration (Weeks)") | ||
company_id = fields.Many2one("res.company", string="Company") | ||
user_id = fields.Many2one("res.users", string="Author") | ||
reason = fields.Text("Reason") | ||
project_id = fields.Many2one("project.project", string="Project") |
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,47 @@ | ||
# 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). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProjectProject(models.Model): | ||
_inherit = "project.project" | ||
|
||
project_end_history_ids = fields.One2many( | ||
"project.end.history", | ||
"project_id", | ||
string="Historics Associated to this Project", | ||
) | ||
project_end_history_count = fields.Integer( | ||
string="End Date Changes Historics", | ||
compute="_compute_project_end_history", | ||
groups="project.group_project_manager", | ||
) | ||
expected_week_duration = fields.Float( | ||
string="Expected Duration (in Weeks)", | ||
compute="_compute_expected_week_duration", | ||
) | ||
|
||
def _compute_expected_week_duration(self): | ||
for project in self: | ||
project.expected_week_duration = ( | ||
(project.date - project.date_start).days / 7 | ||
if project.date and project.date_start | ||
else 0 | ||
) | ||
|
||
def _compute_project_end_history(self): | ||
for project in self: | ||
project.project_end_history_count = len(project.project_end_history_ids) | ||
|
||
def action_edit_expiration_date(self): | ||
self.ensure_one() | ||
action = self.env.ref("project_track_end_date.wizard_edit_end_date").read()[0] | ||
action["context"] = { | ||
"default_initial_date": self.date, | ||
"default_date": self.date, | ||
"default_project_id": self.id, | ||
"default_user_id": self.env.user.id, | ||
"default_company_id": self.company_id.id, | ||
} | ||
return action |
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,3 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_project_end_history_project_manager,project_end_history_project_manager,model_project_end_history,project.group_project_manager,1,0,0,0 | ||
edit_date_wizard_user,edit_date_wizard_user,model_edit_date_wizard,base.group_user,1,1,1,1 |
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.
Binary file added
BIN
+53.5 KB
project_track_end_date/static/description/project_end_date_historic_lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+107 KB
project_track_end_date/static/description/project_end_date_historics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.9 KB
project_track_end_date/static/description/wizard_for_end_date_update.png
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 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_project_end_historic |
Oops, something went wrong.