Skip to content

Commit

Permalink
Merge branch '12.0' into TA#52405
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda authored Aug 7, 2023
2 parents 3f80319 + 1278314 commit 9b2cdc2
Show file tree
Hide file tree
Showing 54 changed files with 916 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"project_milestone_spent_hours",
"project_milestone_start_date",
"project_milestone_time_report",
"project_milestone_time_report_advanced",
"project_milestone_type",
"project_milestone_time_kpi",
"project_milestone_time_pivot",
Expand All @@ -64,6 +65,8 @@
"project_portal_hide_timesheets",
"project_portal_no_subtask",
"project_portal_parent_task",
"project_progress_variance",
"project_projected_hours",
"project_remaining_hours_update",
"project_stage",
"project_stage_allow_timesheet",
Expand Down Expand Up @@ -94,6 +97,7 @@
"project_time_range",
"project_timesheet_analytic_update",
"project_timesheet_time_control_employee_pin",
"project_timesheet_time_control_project_wip_dysfunction",
"project_timesheet_time_control_restricted_group",
"project_type",
"project_wip",
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ COPY project_milestone_responsible /mnt/extra-addons/project_milestone_responsi
COPY project_milestone_spent_hours /mnt/extra-addons/project_milestone_spent_hours
COPY project_milestone_start_date /mnt/extra-addons/project_milestone_start_date
COPY project_milestone_time_report /mnt/extra-addons/project_milestone_time_report
COPY project_milestone_time_report_advanced /mnt/extra-addons/project_milestone_time_report_advanced
COPY project_milestone_type /mnt/extra-addons/project_milestone_type
COPY project_milestone_time_kpi /mnt/extra-addons/project_milestone_time_kpi
COPY project_milestone_time_pivot /mnt/extra-addons/project_milestone_time_pivot
Expand All @@ -63,6 +64,8 @@ COPY project_outsourcing_timesheet_automation /mnt/extra-addons/project_outsou
COPY project_portal_hide_timesheets /mnt/extra-addons/project_portal_hide_timesheets
COPY project_portal_no_subtask /mnt/extra-addons/project_portal_no_subtask
COPY project_portal_parent_task /mnt/extra-addons/project_portal_parent_task
COPY project_progress_variance /mnt/extra-addons/project_progress_variance
COPY project_projected_hours /mnt/extra-addons/project_projected_hours
COPY project_remaining_hours_update /mnt/extra-addons/project_remaining_hours_update
COPY project_milestone_role /mnt/extra-addons/project_milestone_role
COPY project_stage /mnt/extra-addons/project_stage
Expand Down Expand Up @@ -94,6 +97,7 @@ COPY project_time_budget /mnt/extra-addons/project_time_budget
COPY project_time_range /mnt/extra-addons/project_time_range
COPY project_timesheet_analytic_update /mnt/extra-addons/project_timesheet_analytic_update
COPY project_timesheet_time_control_employee_pin /mnt/extra-addons/project_timesheet_time_control_employee_pin
COPY project_timesheet_time_control_project_wip_dysfunction /mnt/extra-addons/project_timesheet_time_control_project_wip_dysfunction
COPY project_timesheet_time_control_restricted_group /mnt/extra-addons/project_timesheet_time_control_restricted_group
COPY project_type /mnt/extra-addons/project_type
COPY project_wip /mnt/extra-addons/project_wip
Expand Down
2 changes: 1 addition & 1 deletion project_material/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Project Material",
"version": "1.3.1",
"version": "1.3.2",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
Expand Down
11 changes: 8 additions & 3 deletions project_material/models/project_task_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ class TaskMaterialLine(models.Model):
compute_sudo=True,
)
product_uom_id = fields.Many2one(related="product_id.uom_id", readonly=True)
unit_cost = fields.Float(
related="product_id.standard_price", string="Unit Cost", readonly=True
)
unit_cost = fields.Float(string="Unit Cost",
compute='_compute_unit_cost',
)
move_ids = fields.One2many("stock.move", "material_line_id", "Stock Moves")

def _compute_unit_cost(self):
for record in self:
record.unit_cost = record.with_context(
force_company=record.company_id.id).product_id.standard_price

@api.depends(
"move_ids.move_orig_ids",
"move_ids.move_orig_ids.state",
Expand Down
33 changes: 33 additions & 0 deletions project_milestone_time_report_advanced/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Project Milestone Time Report Advanced
======================================
This module allows on Projects module, when editing time report by Milestones, from the Smart button [Milestones time report],
to see the following information (also available on PDF report):
* Project status
* Start date
* End date
* Todos

Usage
-----
As a user, when I view the time by milestone report from a project form, the following additional columns are displayed:
* Project status
* Start date
* End date
* Todos

.. image:: static/description/project_miestone_time_report.png

.. image:: static/description/new_columns_milestone_time_report.png

The lines of each project are grouped by stage (project_id.stage_id) and the groups are sorted in ascending order according to the sequence associated with the stages of the projects (project_id.stage_id.sequence).
Within each of the groupings, the batch lines are sorted by start date.

.. image:: static/description/sorting_and_grouping_on_report.png

When I print the report to pdf, the report has these new columns, sorting and grouping.

.. image:: static/description/pdf_report.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
4 changes: 4 additions & 0 deletions project_milestone_time_report_advanced/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import report
22 changes: 22 additions & 0 deletions project_milestone_time_report_advanced/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Project Milestone Time Report Advanced",
"version": "1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"category": "Project",
"depends": [
"project_milestone_time_report",
"project_milestone_time_kpi",
"project_stage",
],
"summary": "Add new informations on Milestones time report.",
"data": [
"report/report.xml",
],
"installable": True,
}
36 changes: 36 additions & 0 deletions project_milestone_time_report_advanced/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_time_report_advanced
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-29 14:43+0000\n"
"PO-Revision-Date: 2023-06-29 14:43+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_time_report_advanced
#: model_terms:ir.ui.view,arch_db:project_milestone_time_report_advanced.report_body
msgid "End"
msgstr "Fin"

#. module: project_milestone_time_report_advanced
#: model:ir.model,name:project_milestone_time_report_advanced.model_project_milestone_time_report
msgid "Milestone Time Report"
msgstr "Rapport de temps des jalons"

#. module: project_milestone_time_report_advanced
#: model_terms:ir.ui.view,arch_db:project_milestone_time_report_advanced.report_body
msgid "Start"
msgstr "Début"

#. module: project_milestone_time_report_advanced
#: model_terms:ir.ui.view,arch_db:project_milestone_time_report_advanced.report_body
msgid "Todos"
msgstr "Reste à faire"
4 changes: 4 additions & 0 deletions project_milestone_time_report_advanced/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2022 - Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import report
50 changes: 50 additions & 0 deletions project_milestone_time_report_advanced/report/report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# © 2022 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import datetime

from odoo import api, models


class ProjectMilestoneTimeReport(models.AbstractModel):
_inherit = "project.milestone.time.report"

@api.model
def _get_project_line(self, project):
res = super()._get_project_line(project)
res["date_start"] = project.date_start
res["date_end"] = project.date
res["total_remaining_hours"] = project.total_remaining_hours
res["stage"] = project.stage_id
return res

@api.model
def get_rendering_variables(self, project):
res = super().get_rendering_variables(project)
res["stage_lines"] = self._get_project_stages(project)
return res

@api.model
def _get_project_stages(self, project):
lots = project.child_ids.filtered(lambda p: not p.lump_sum)
projects = project | lots
stage_ids = list(set([p.stage_id.id for p in projects]))
stage_ids = (
self.env["project.stage"].browse(stage_ids).sorted(key=lambda p: p.sequence)
)
return [self._get_project_stage_line(s) for s in stage_ids]

@api.model
def _get_project_stage_line(self, stage):
return {
"stage": stage,
}

@api.model
def _get_lines(self, project):
super()._get_lines(project)
lots = project.child_ids.filtered(lambda p: not p.lump_sum)
projects = (project | lots).sorted(
key=lambda a: (a.stage_id, (a.date_start or datetime.date(1970, 1, 1)))
)
return [self._get_project_line(p) for p in projects]
89 changes: 89 additions & 0 deletions project_milestone_time_report_advanced/report/report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_body" inherit_id="project_milestone_time_report.report_body">
<!-- Start and End date -->
<xpath expr="//table[hasclass('o_project_report__content')]/thead/tr[1]/th[1]" position="after">
<th class="text-right">Start</th>
<th class="text-right">End</th>
</xpath>
<xpath expr="//table[hasclass('o_project_report__content')]/thead/tr[1]/th[last()]" position="after">
<th class="text-right">Todos</th>
</xpath>
<!-- Stage grouping -->
<xpath expr="//table[hasclass('o_project_report__content')]/tbody" position="replace">
<tbody>
<tr t-foreach="stage_lines" t-as="stage_line" style="background-color: #d9d8d7;">
<t t-set="stage" t-value="stage_line['stage']"/>
<td style="padding-left: 7px; font-size: 13px; color: blue; font-weight: bold;">
<span t-raw="stage.display_name"/>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>

<tr t-foreach="lines" t-as="line">
<t t-set="project" t-value="line['project']"/>
<t t-if="project.stage_id == stage">
<td>
<span t-raw="project.display_name"/>
</td>
<td class="text-right">
<span t-raw="line['date_start']" t-options="{'widget': 'date'}"/>
</td>
<td class="text-right">
<span t-raw="line['date_end']" t-options="{'widget': 'date'}"/>
</td>
<td
class="text-right o_project_report__amount o_project_report__estimated_hours"
t-att-project-id="project.id"
>
<span t-raw="line['total_estimated_hours']" t-options="{'widget': 'float_time'}"/>
</td>
<td
class="text-right o_project_report__amount o_project_report__consumed_hours"
t-att-project-id="project.id"
>
<span t-raw="line['consumed_hours']" t-options="{'widget': 'float_time'}"/>
</td>
<td class="text-right">
<span t-raw="line['budget_remaining']" t-options="{'widget': 'float_time'}"/>
</td>
<td class="text-right">
<span t-raw="line['total_remaining_hours']" t-options="{'widget': 'float_time'}"/>
</td>
</t>
</tr>
</tr>
<tr class="o_project_report__totals">
<td></td>
<td></td>
<td></td>
<td
class="text-right o_project_report__amount o_project_report__total_estimated_hours"
>
<span t-raw="sum(l['total_estimated_hours'] for l in lines)"
t-options="{'widget': 'float_time'}"/>
</td>
<td
class="text-right o_project_report__amount o_project_report__total_consumed_hours"
>
<span t-raw="sum(l['consumed_hours'] for l in lines)"
t-options="{'widget': 'float_time'}"/>
</td>
<td class="text-right">
<span t-raw="sum(l['budget_remaining'] for l in lines)"
t-options="{'widget': 'float_time'}"/>
</td>
<td class="text-right">
<span t-raw="sum(l['total_remaining_hours'] for l in lines)"
t-options="{'widget': 'float_time'}"/>
</td>
</tr>
</tbody>
</xpath>
</template>

</odoo>
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.
28 changes: 28 additions & 0 deletions project_progress_variance/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Project Progress Variance
=========================
This module allows to:

* Add the ”Variance on progress” field in the form view of a task
Computed as : task real progress + task theorical progress.

.. image:: static/description/task_progress_variance.png

* Add the “Variance on progress” in the analysis list view “Progress of tasks”

.. image:: static/description/task_progress_report.png

* Add the ”Progress” tab in the form view of a project
* The “Total theoretical progress” field
Computed as : total of effective hours of project tasks / total of planned hours of project tasks.

* The "Total real progress" field
Computed as : total of effective hours of project tasks / total of projected hours of project tasks.

* The “Total variance on progress” field
Computed as : total of real progress - Total theoretical progress.

.. image:: static/description/project_progress_tab.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
4 changes: 4 additions & 0 deletions project_progress_variance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
20 changes: 20 additions & 0 deletions project_progress_variance/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Project Progress Variance",
"version": "1.0.1",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"category": "Project",
"depends": ["project_projected_hours"],
"summary": "Add some progress variance time on task and project",
"data": [
"views/project_project.xml",
"views/project_task.xml",
"views/project_task_progress_report.xml",
],
"installable": True,
}
Loading

0 comments on commit 9b2cdc2

Please sign in to comment.