Skip to content

Commit

Permalink
TA#72208 [16.0][MIG] project_track_end_date (#463)
Browse files Browse the repository at this point in the history
* 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
lanto-razafindrabe and abenzbiria authored Dec 9, 2024
1 parent 80ad5b5 commit f58c6e8
Show file tree
Hide file tree
Showing 23 changed files with 539 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"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_stage_allow_timesheet",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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

Expand All @@ -20,3 +21,4 @@
branch: "16.0"
includes:
- web_ir_actions_act_multi
- web_timeline
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,
}
169 changes: 169 additions & 0 deletions project_track_end_date/i18n/fr.po
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"
7 changes: 7 additions & 0 deletions project_track_end_date/models/__init__.py
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,
)
19 changes: 19 additions & 0 deletions project_track_end_date/models/project_end_history.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 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")
47 changes: 47 additions & 0 deletions project_track_end_date/models/project_project.py
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
3 changes: 3 additions & 0 deletions project_track_end_date/security/ir.model.access.csv
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.
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.
4 changes: 4 additions & 0 deletions project_track_end_date/tests/__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 AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import test_project_end_historic
Loading

0 comments on commit f58c6e8

Please sign in to comment.