Skip to content

Commit

Permalink
TA#72163 [16.0][MIG][ADD] project_milestone_enhanced : adding feature…
Browse files Browse the repository at this point in the history
… from 12
  • Loading branch information
lanto-razafindrabe committed Dec 4, 2024
1 parent a5bef9a commit 463567b
Show file tree
Hide file tree
Showing 9 changed files with 380 additions and 22 deletions.
1 change: 1 addition & 0 deletions project_milestone_enhanced/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"data": [
"views/project_milestone.xml",
"views/project.xml",
"views/task_stage.xml",
],
"installable": True,
}
222 changes: 218 additions & 4 deletions project_milestone_enhanced/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,49 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-03 06:25+0000\n"
"PO-Revision-Date: 2024-12-03 06:25+0000\n"
"POT-Creation-Date: 2024-12-04 15:24+0000\n"
"PO-Revision-Date: 2024-12-04 15:24+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_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_needaction
msgid "Action Needed"
msgstr "Nécessite une action"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__active
msgid "Active"
msgstr "Actif"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_ids
msgid "Activities"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_exception_decoration
msgid "Activity Exception Decoration"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_state
msgid "Activity State"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_type_icon
msgid "Activity Type Icon"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.ui.menu,name:project_milestone_enhanced.milestone_configuration_menu
msgid "All Milestones"
msgstr "Tous les jalons"

#. module: project_milestone_enhanced
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_active_view_form
Expand All @@ -34,13 +64,140 @@ msgid ""
msgstr ""
"Archiver un projet archivera automatiquement ses tâches et jalons. Voulez-vous continuer ?"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_attachment_count
msgid "Attachment Count"
msgstr "Nombre de pièces jointes"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_task_type__closed
msgid "Closed"
msgstr "Clôturé"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_follower_ids
msgid "Followers"
msgstr "Abonnés"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_partner_ids
msgid "Followers (Partners)"
msgstr "Abonnés (Partenaires)"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__activity_type_icon
msgid "Font awesome icon e.g. fa-tasks"
msgstr ""

#. module: project_milestone_enhanced
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_milestone_view_search
msgid "Group By"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__has_message
msgid "Has Message"
msgstr "A un message"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_exception_icon
msgid "Icon"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__activity_exception_icon
msgid "Icon to indicate an exception activity."
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__message_needaction
msgid "If checked, new messages require your attention."
msgstr "Si coché, de nouveaux messages demandent votre attention."

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__message_has_error
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr "Si coché, certains messages ont une erreur de livraison."

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_is_follower
msgid "Is Follower"
msgstr "Est un abonné"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_main_attachment_id
msgid "Main Attachment"
msgstr "Pièce jointe principale"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_has_error
msgid "Message Delivery error"
msgstr "Erreur d'envoi du message"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_ids
msgid "Messages"
msgstr ""

#. module: project_milestone_enhanced
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_active_view_form
msgid "Milestones"
msgstr "Jalons"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__my_activity_date_deadline
msgid "My Activity Deadline"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_date_deadline
msgid "Next Activity Deadline"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_summary
msgid "Next Activity Summary"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_type_id
msgid "Next Activity Type"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_needaction_counter
msgid "Number of Actions"
msgstr "Nombre d'actions"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_has_error_counter
msgid "Number of errors"
msgstr "Nombre d'erreurs"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__message_needaction_counter
msgid "Number of messages requiring action"
msgstr "Nombre de messages nécessitant une action"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__message_has_error_counter
msgid "Number of messages with delivery error"
msgstr "Nombre de messages avec des erreurs d'envoi"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__progress
msgid "Percentage of Completed Tasks vs Incomplete Tasks."
msgstr "Pourcentage de tâches achevées par rapport aux tâches incomplètes."

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__progress
msgid "Progress"
msgstr "Progression"

#. module: project_milestone_enhanced
#: model:ir.model,name:project_milestone_enhanced.model_project_project
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_milestone_view_search
msgid "Project"
msgstr "Projet"

Expand All @@ -49,21 +206,68 @@ msgstr "Projet"
msgid "Project Milestone"
msgstr "Jalon du projet"

#. module: project_milestone_enhanced
#: model:ir.actions.act_window,name:project_milestone_enhanced.project_milestone_action
msgid "Project Milestones"
msgstr "Jalons du projet"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__activity_user_id
msgid "Responsible User"
msgstr ""

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__message_has_sms_error
msgid "SMS Delivery error"
msgstr "Erreur d'envoi SMS"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__sequence
msgid "Sequence"
msgstr "Séquence"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_project__show_milestones
msgid "Show milestones"
msgstr "Afficher les jalons"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__activity_state
msgid ""
"Status based on activities\n"
"Overdue: Due date is already passed\n"
"Today: Activity date is today\n"
"Planned: Future activities."
msgstr "Statut basé sur les activités\n"
"En retard : la date d'échéance est déjà dépassée\n"
"Aujourd'hui : la date de l'activité est aujourd'hui\n"
"Planifié : activités futures."

#. module: project_milestone_enhanced
#: model:ir.model,name:project_milestone_enhanced.model_project_task_type
msgid "Task Stage"
msgstr "Étape de tâche"

#. module: project_milestone_enhanced
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_milestone_active_view_form
msgid "Tasks"
msgstr "Tâches"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_task_type__closed
msgid "Tasks in this stage are considered closed."
msgstr "Les tâches dans cette étape sont considérées comme clôturées."

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__active_toggle
msgid "Toggle active"
msgstr "Toggle actif"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__activity_exception_decoration
msgid "Type of the exception activity on record."
msgstr "Type d'activité d'exception enregistrée."

#. module: project_milestone_enhanced
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_active_view_form
#: model_terms:ir.ui.view,arch_db:project_milestone_enhanced.project_milestone_active_view_form
Expand All @@ -76,4 +280,14 @@ msgid ""
"Unarchiving a project automatically unarchives its tasks and milestones. Do "
"you want to proceed ?"
msgstr ""
""Désarchiver un projet désarchivera automatiquement ses tâches et jalons. Voulez-vous continuer ?"
""Désarchiver un projet désarchivera automatiquement ses tâches et jalons. Voulez-vous continuer ?"

#. module: project_milestone_enhanced
#: model:ir.model.fields,field_description:project_milestone_enhanced.field_project_milestone__website_message_ids
msgid "Website Messages"
msgstr "Messages du site web"

#. module: project_milestone_enhanced
#: model:ir.model.fields,help:project_milestone_enhanced.field_project_milestone__website_message_ids
msgid "Website communication history"
msgstr "Historique de communication du site web"
1 change: 1 addition & 0 deletions project_milestone_enhanced/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

from . import project

Check notice on line 4 in project_milestone_enhanced/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_milestone_enhanced/models/__init__.py#L4

'.project' imported but unused (F401)
from . import project_milestone

Check notice on line 5 in project_milestone_enhanced/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_milestone_enhanced/models/__init__.py#L5

'.project_milestone' imported but unused (F401)
from . import task_stage

Check notice on line 6 in project_milestone_enhanced/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

project_milestone_enhanced/models/__init__.py#L6

'.task_stage' imported but unused (F401)
26 changes: 24 additions & 2 deletions project_milestone_enhanced/models/project_milestone.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# 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
from odoo import api, models, fields


class ProjectMilestone(models.Model):
_inherit = "project.milestone"
_name = "project.milestone"

_inherit = ['project.milestone', 'mail.thread', 'mail.activity.mixin']

active = fields.Boolean(string="Active", default=True)
active_toggle = fields.Boolean(string="Toggle active", default=True)
sequence = fields.Integer()
progress = fields.Float(
compute="_compute_milestone_progress",
store=True,
help="Percentage of Completed Tasks vs Incomplete Tasks.",
)

def toggle_active(self):
res = super(ProjectMilestone, self).toggle_active()
Expand Down Expand Up @@ -38,3 +46,17 @@ def _milestone_not_active(self):
self.filtered(lambda milestone: not milestone.active_toggle).write(
{"active": False}
)

@api.depends('task_ids.stage_id')
def _compute_milestone_progress(self):
total_tasks_count = 0.0
closed_tasks_count = 0.0
for record in self:
for task_record in record.task_ids:
total_tasks_count += 1
if task_record.stage_id.closed:
closed_tasks_count += 1
if total_tasks_count > 0:
record.progress = (closed_tasks_count / total_tasks_count) * 100
else:
record.progress = 0.0
13 changes: 13 additions & 0 deletions project_milestone_enhanced/models/task_stage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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 ProjectTaskType(models.Model):
_inherit = 'project.task.type'

closed = fields.Boolean(
help="Tasks in this stage are considered closed.",
default=False,
)
Loading

0 comments on commit 463567b

Please sign in to comment.