Move 124 sale modules to oca-sale, create oca-project with 56 project modules from oca-workflow-process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ernad Husremovic 2025-08-30 18:04:10 +02:00
parent 9eb7ae5807
commit 6094c218b2
2332 changed files with 125826 additions and 0 deletions

View file

@ -0,0 +1,82 @@
========================
Project Milestone Status
========================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5d1c9b95cab4feb86a69042881bdd649e8f512c4a7fb537afeec9226ee62a9ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-APSL--Nagarro%2Fcustom-lightgray.png?logo=github
:target: https://github.com/APSL-Nagarro/custom/tree/16.0/project_milestone_status
:alt: APSL-Nagarro/custom
|badge1| |badge2| |badge3|
This module allows you to have the percentage of the execution of a
project.
**Table of contents**
.. contents::
:local:
Usage
=====
Execution: It is the percentage between hours of tasks completed and
pending tasks Dedication: It is the percentage between planned hours and
effective hours.
These percentages are shown in Milestones and Project Updates of
projects.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/APSL-Nagarro/custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/APSL-Nagarro/custom/issues/new?body=module:%20project_milestone_status%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Lansana Barry Sow
* APSL-Nagarro
Contributors
------------
[APSL-Nagarro](https://apsl.tech):
- Lansana Barry Sow <lbarry@apsl.net>
Maintainers
-----------
.. |maintainer-lbarry-apsl| image:: https://github.com/lbarry-apsl.png?size=40px
:target: https://github.com/lbarry-apsl
:alt: lbarry-apsl
Current maintainer:
|maintainer-lbarry-apsl|
This module is part of the `APSL-Nagarro/custom <https://github.com/APSL-Nagarro/custom/tree/16.0/project_milestone_status>`_ project on GitHub.
You are welcome to contribute.

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,20 @@
# Copyright 2025 Lansana Barry Sow(APSL-Nagarro)<lbarry@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Project Milestone Status",
"version": "16.0.1.0.0",
"category": "Project",
"website": "https://github.com/OCA/project",
"author": "Lansana Barry Sow, APSL-Nagarro, Odoo Community Association (OCA)",
"maintainers": ["lbarry-apsl"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"project",
],
"data": [
"views/project_milestone_views.xml",
"views/project_views.xml",
],
}

View file

@ -0,0 +1,64 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_status
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \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_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#, python-format
msgid "%(name)s"
msgstr "%(name)s"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__dedication
#, python-format
msgid "Dedication"
msgstr "Posvećenost"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__execution
#, python-format
msgid "Execution"
msgstr "Izvršavanje"
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid ""
"Keep track of the progress of your tasks from creation to completion.<br>\n"
" Collaborate efficiently by chatting in real-time or via email."
msgstr ""
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid "No tasks found. Let's create one!"
msgstr "Nema pronađenih zadataka. Kreiraj novi!"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_project
msgid "Project"
msgstr "Projekat"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_milestone
msgid "Project Milestone"
msgstr "Prekretnica projekta"
#. module: project_milestone_status
#: model:ir.actions.act_window,name:project_milestone_status.act_excuted_project_task
msgid "Tasks"
msgstr "Zadaci"

View file

@ -0,0 +1,70 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_status
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-19 07:22+0000\n"
"PO-Revision-Date: 2025-03-19 08:25+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#, python-format
msgid "%(name)s"
msgstr ""
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__dedication
#, python-format
msgid "Dedication"
msgstr "Dedicación"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__execution
#, python-format
msgid "Execution"
msgstr "Ejecución"
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid ""
"Keep track of the progress of your tasks from creation to completion.<br>\n"
" Collaborate efficiently by chatting in real-time or via email."
msgstr ""
"Monitorea el progreso de tus tareas desde su creación hasta su finalización.<br>\n"
"Colabora eficientemente chateando en tiempo real o por correo electrónico."
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid "No tasks found. Let's create one!"
msgstr "No se encontraron tareas. ¡Creemos una!"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_project
msgid "Project"
msgstr "Proyecto"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_milestone
msgid "Project Milestone"
msgstr "Hito de proyecto"
#. module: project_milestone_status
#: model:ir.actions.act_window,name:project_milestone_status.act_excuted_project_task
msgid "Tasks"
msgstr "Tareas"

View file

@ -0,0 +1,71 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_status
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-05-10 14:23+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#, python-format
msgid "%(name)s"
msgstr "%(name)s"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__dedication
#, python-format
msgid "Dedication"
msgstr "Dedizione"
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__execution
#, python-format
msgid "Execution"
msgstr "Esecuzione"
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid ""
"Keep track of the progress of your tasks from creation to completion.<br>\n"
" Collaborate efficiently by chatting in real-time or via email."
msgstr ""
"Tiene traccia dell'avanzamento dei propri lavori dalla creazione al "
"completamento.<br>\n"
" Collabora efficientemente dialogando in tempo reale o per "
"e-mail."
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid "No tasks found. Let's create one!"
msgstr "Nessun lavoro trovato! Creiamone uno!"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_project
msgid "Project"
msgstr "Progetto"
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_milestone
msgid "Project Milestone"
msgstr "Milestone progetto"
#. module: project_milestone_status
#: model:ir.actions.act_window,name:project_milestone_status.act_excuted_project_task
msgid "Tasks"
msgstr "Lavori"

View file

@ -0,0 +1,64 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_status
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \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_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#, python-format
msgid "%(name)s"
msgstr ""
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__dedication
#, python-format
msgid "Dedication"
msgstr ""
#. module: project_milestone_status
#. odoo-python
#: code:addons/project_milestone_status/models/project.py:0
#: model:ir.model.fields,field_description:project_milestone_status.field_project_milestone__execution
#, python-format
msgid "Execution"
msgstr ""
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid ""
"Keep track of the progress of your tasks from creation to completion.<br>\n"
" Collaborate efficiently by chatting in real-time or via email."
msgstr ""
#. module: project_milestone_status
#: model_terms:ir.actions.act_window,help:project_milestone_status.act_excuted_project_task
msgid "No tasks found. Let's create one!"
msgstr ""
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_project
msgid "Project"
msgstr ""
#. module: project_milestone_status
#: model:ir.model,name:project_milestone_status.model_project_milestone
msgid "Project Milestone"
msgstr ""
#. module: project_milestone_status
#: model:ir.actions.act_window,name:project_milestone_status.act_excuted_project_task
msgid "Tasks"
msgstr ""

View file

@ -0,0 +1,2 @@
from . import project_milestone
from . import project

View file

@ -0,0 +1,103 @@
import ast
import json
from odoo import _, models
class Project(models.Model):
_inherit = "project.project"
def _get_execution(self):
all_tasks = self.env["project.task"].search(
[
("project_id", "=", self.id),
]
)
executed_tasks = all_tasks.filtered("stage_id.fold")
total_planned_hours = sum(all_tasks.mapped("planned_hours"))
total_excuted_hours = sum(executed_tasks.mapped("planned_hours"))
if total_excuted_hours and total_planned_hours:
execution = total_excuted_hours * 100 / total_planned_hours
else:
execution = 0
return {
"all_task": len(all_tasks),
"excuted": round(total_excuted_hours),
"percent": round(execution),
}
def _get_dedication(self):
all_tasks = self.env["project.task"].search(
[
("project_id", "=", self.id),
]
)
total_planned_hours = sum(all_tasks.mapped("planned_hours"))
total_dedicated_hours = sum(all_tasks.mapped("effective_hours"))
if total_dedicated_hours and total_planned_hours:
dedication = total_dedicated_hours * 100 / total_planned_hours
else:
dedication = 0
return {"dedicated": round(total_dedicated_hours), "percent": round(dedication)}
def action_view_excuted_tasks(self):
action = (
self.env["ir.actions.act_window"]
.with_context(active_id=self.id)
._for_xml_id("project_milestone_status.act_excuted_project_task")
)
action["display_name"] = _("%(name)s", name=self.name)
context = action["context"].replace("active_id", str(self.id))
context = ast.literal_eval(context)
context.update({"create": self.active, "active_test": self.active})
action["context"] = context
action["domain"] = [("project_id", "=", self.id), ("stage_id.fold", "=", True)]
return action
def _get_stat_buttons(self):
buttons = super()._get_stat_buttons()
execution = self._get_execution()
dedication = self._get_dedication()
if self.task_count and execution["all_task"]:
percent_tasks = round(self.task_count * 100 / execution["all_task"])
else:
percent_tasks = 0
buttons[0][
"number"
] = f"{self.task_count} / {execution['all_task']} ({percent_tasks}%)"
buttons.append(
{
"icon": "check-circle-o",
"text": _("Execution"),
"number": f"{execution['percent']}% ({execution['excuted']}h)",
"action_type": "object",
"action": "action_view_excuted_tasks",
"show": True,
"sequence": 5,
}
)
buttons.append(
{
"icon": "clock-o",
"text": _("Dedication"),
"number": f"{dedication['percent']}% ({dedication['dedicated']}h)",
"action_type": "action",
"action": "hr_timesheet.act_hr_timesheet_line_by_project",
"additional_context": json.dumps(
{
"active_id": self.id,
}
),
"show": True,
"sequence": 6,
}
)
return buttons

View file

@ -0,0 +1,32 @@
from odoo import api, fields, models
class ProjectMilestone(models.Model):
_inherit = "project.milestone"
execution = fields.Integer(compute="_compute_execution")
dedication = fields.Integer(compute="_compute_dedication")
@api.depends("task_ids")
def _compute_execution(self):
for milestone in self:
executed_tasks = milestone.task_ids.filtered("stage_id.fold")
total_planned_hours = sum(milestone.task_ids.mapped("planned_hours"))
total_excuted_hours = sum(executed_tasks.mapped("planned_hours"))
if total_excuted_hours and total_planned_hours:
milestone.execution = total_excuted_hours * 100 / total_planned_hours
else:
milestone.execution = 0
@api.depends("task_ids")
def _compute_dedication(self):
for milestone in self:
total_planned_hours = sum(milestone.task_ids.mapped("planned_hours"))
total_dedicated_hours = sum(milestone.task_ids.mapped("effective_hours"))
if total_dedicated_hours and total_planned_hours:
milestone.dedication = total_dedicated_hours * 100 / total_planned_hours
else:
milestone.dedication = 0

View file

@ -0,0 +1,2 @@
\[APSL-Nagarro\](<https://apsl.tech>):
- Lansana Barry Sow \<<lbarry@apsl.net>\>

View file

@ -0,0 +1 @@
This module allows you to have the percentage of the execution of a project.

View file

@ -0,0 +1,4 @@
Execution: It is the percentage between hours of tasks completed and pending tasks
Dedication: It is the percentage between planned hours and effective hours.
These percentages are shown in Milestones and Project Updates of projects.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 45 KiB

View file

@ -0,0 +1,430 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Project Milestone Status</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="project-milestone-status">
<h1 class="title">Project Milestone Status</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5d1c9b95cab4feb86a69042881bdd649e8f512c4a7fb537afeec9226ee62a9ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/APSL-Nagarro/custom/tree/16.0/project_milestone_status"><img alt="APSL-Nagarro/custom" src="https://img.shields.io/badge/github-APSL--Nagarro%2Fcustom-lightgray.png?logo=github" /></a></p>
<p>This module allows you to have the percentage of the execution of a
project.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>Execution: It is the percentage between hours of tasks completed and
pending tasks Dedication: It is the percentage between planned hours and
effective hours.</p>
<p>These percentages are shown in Milestones and Project Updates of
projects.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/APSL-Nagarro/custom/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/APSL-Nagarro/custom/issues/new?body=module:%20project_milestone_status%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Lansana Barry Sow</li>
<li>APSL-Nagarro</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<p>[APSL-Nagarro](<a class="reference external" href="https://apsl.tech">https://apsl.tech</a>):</p>
<ul class="simple">
<li>Lansana Barry Sow &lt;<a class="reference external" href="mailto:lbarry&#64;apsl.net">lbarry&#64;apsl.net</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>Current maintainer:</p>
<p><a class="reference external image-reference" href="https://github.com/lbarry-apsl"><img alt="lbarry-apsl" src="https://github.com/lbarry-apsl.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/APSL-Nagarro/custom/tree/16.0/project_milestone_status">APSL-Nagarro/custom</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,2 @@
from . import test_project_milestone_status
from . import test_project_status

View file

@ -0,0 +1,39 @@
from odoo.tests import new_test_user
from odoo.tests.common import TransactionCase
class ProjectMilestoneStatusCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.timesheet_line_model = cls.env["account.analytic.line"]
cls.project1 = cls.env["project.project"].create({"name": "Project 1"})
cls.milestone1 = cls.env["project.milestone"].create(
{"name": "Milestone 1", "project_id": cls.project1.id}
)
cls.user = new_test_user(
cls.env, login="test-user", groups="hr_timesheet.group_hr_timesheet_user"
)
cls.employee_1 = cls.env["hr.employee"].create(
{
"name": "Test employee 1",
"user_id": cls.user.id,
}
)
cls.task1 = cls.env["project.task"].create(
{
"name": "name1",
"project_id": cls.project1.id,
"milestone_id": cls.milestone1.id,
"planned_hours": 5.0,
}
)
cls.task2 = cls.env["project.task"].create(
{
"name": "name2",
"project_id": cls.project1.id,
"milestone_id": cls.milestone1.id,
"planned_hours": 5.0,
}
)

View file

@ -0,0 +1,51 @@
from odoo.addons.project_milestone_status.tests.common import (
ProjectMilestoneStatusCommon,
)
class TestProjectMilestoneStatus(ProjectMilestoneStatusCommon):
def test_check_execution_empty(self):
project_milestone_id = self.project1.milestone_ids.browse(self.milestone1.id)
self.assertEqual(
project_milestone_id.execution, 0, "There is no execution at the milestone"
)
def test_check_execution_done(self):
project_milestone_id = self.project1.milestone_ids.browse(self.milestone1.id)
self.task1.write(
{
"stage_id": self.env["project.task.type"]
.search([("fold", "=", True)], limit=1)
.id
}
)
self.assertEqual(
project_milestone_id.execution,
50,
"There is a 50 percent execution of the milestone",
)
def test_check_dedication_empty(self):
project_milestone_id = self.project1.milestone_ids.browse(self.milestone1.id)
self.assertEqual(
project_milestone_id.dedication,
0,
"There is no dedication in the milestone",
)
def test_check_dedication_done(self):
project_milestone_id = self.project1.milestone_ids.browse(self.milestone1.id)
self.timesheet_line_model.create(
{
"name": "test",
"employee_id": self.employee_1.id,
"unit_amount": 2.0,
"project_id": self.project1.id,
"task_id": self.task1.id,
}
)
self.assertEqual(
project_milestone_id.dedication,
20,
"There is a 20 percent dedication in the milestone",
)

View file

@ -0,0 +1,40 @@
from odoo.addons.project_milestone_status.tests.common import (
ProjectMilestoneStatusCommon,
)
class TestProjectStatus(ProjectMilestoneStatusCommon):
def test_check_execution_empty(self):
self.assertEqual(self.project1._get_execution()["all_task"], 2)
self.assertEqual(self.project1._get_execution()["excuted"], 0)
self.assertEqual(self.project1._get_execution()["percent"], 0)
def test_check_execution_done(self):
self.task1.write(
{
"stage_id": self.env["project.task.type"]
.search([("fold", "=", True)], limit=1)
.id
}
)
self.assertEqual(self.project1._get_execution()["all_task"], 2)
self.assertEqual(self.project1._get_execution()["excuted"], 5)
self.assertEqual(self.project1._get_execution()["percent"], 50)
def test_check_dedication_empty(self):
self.assertEqual(self.project1._get_dedication()["dedicated"], 0)
self.assertEqual(self.project1._get_dedication()["percent"], 0)
def test_check_dedication_done(self):
self.project1.milestone_ids.browse(self.milestone1.id)
self.timesheet_line_model.create(
{
"name": "test",
"employee_id": self.employee_1.id,
"unit_amount": 2.0,
"project_id": self.project1.id,
"task_id": self.task1.id,
}
)
self.assertEqual(self.project1._get_dedication()["dedicated"], 2)
self.assertEqual(self.project1._get_dedication()["percent"], 20)

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="project_milestone_view_tree" model="ir.ui.view">
<field name="model">project.milestone</field>
<field name="inherit_id" ref="project.project_milestone_view_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field
name="execution"
widget="progressbar"
decoration-danger="execution &lt; dedication"
decoration-success="execution &gt; dedication"
/>
<field
name="dedication"
widget="progressbar"
decoration-danger="execution &lt; dedication"
decoration-success="execution &gt; dedication"
/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="act_excuted_project_task" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">project.task</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('display_project_id', '=', active_id)]</field>
<field name="context">{
'default_project_id': active_id,
'show_project_update': True,
}</field>
<field name="search_view_id" ref="project.view_task_search_form" />
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No tasks found. Let's create one!
</p>
<p>
Keep track of the progress of your tasks from creation to completion.<br
/>
Collaborate efficiently by chatting in real-time or via email.
</p>
</field>
</record>
</odoo>