diff --git a/.docker_files/main/__manifest__.py b/.docker_files/main/__manifest__.py index c36d185e..e7d3b720 100644 --- a/.docker_files/main/__manifest__.py +++ b/.docker_files/main/__manifest__.py @@ -11,18 +11,18 @@ "category": "Other", "summary": "Install all addons required for testing.", "depends": [ - "project", + "project_default_task_stage", + "project_milestone_enhanced", + "project_milestone_estimated_hours", + "project_milestone_spent_hours", + "project_parent_enhanced", + "project_stage_allow_timesheet", "project_task_date_planned", "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_milestone_enhanced", - "project_milestone_spent_hours", - "project_parent_enhanced", - "project_stage_allow_timesheet", ], "installable": True, } diff --git a/Dockerfile b/Dockerfile index 040972a3..18c587bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,19 +13,18 @@ RUN gitoo install-all --conf_file /gitoo.yml --destination "${THIRD_PARTY_ADDONS USER odoo -COPY project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet +COPY project_default_task_stage /mnt/extra-addons/project_default_task_stage +COPY project_milestone_enhanced /mnt/extra-addons/project_milestone_enhanced +COPY project_milestone_estimated_hours /mnt/extra-addons/project_milestone_estimated_hours +COPY project_milestone_spent_hours /mnt/extra-addons/project_milestone_spent_hours COPY project_parent_enhanced mnt/extra-addons/project_parent_enhanced +COPY project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet 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 -COPY project_milestone_enhanced /mnt/extra-addons/project_milestone_enhanced -COPY project_milestone_spent_hours /mnt/extra-addons/project_milestone_spent_hours - - COPY .docker_files/main /mnt/extra-addons/main COPY .docker_files/odoo.conf /etc/odoo diff --git a/project_milestone_estimated_hours/README.rst b/project_milestone_estimated_hours/README.rst new file mode 100644 index 00000000..54b40b23 --- /dev/null +++ b/project_milestone_estimated_hours/README.rst @@ -0,0 +1,40 @@ +Project Milestone Estimated Hours +================================= + +.. contents:: Table of Contents + +Context +------- +Natively, Odoo allows to define milestones for a project. + +Multiple tasks in the project can be linked to a given milestone. + + +Description +----------- +Field estimated hours is displayed in form and list view of a project milestone and in tab of milestones of a project. +when a milestone is copied, value of estimated hours is copied too. + +Overview +-------- + +I open the form of a project milestone and set value in field "Estimated hours. + +.. image:: static/description/project_milestone_form.png + +I copy the milestone and value in field "Estimated hours is the same. + +.. image:: static/description/project_milestone_copy.png + +I open the list of milestones, the field is displayed. + +.. image:: static/description/project_milestone_tree.png + +I open the form of a project with notebook milestones, the field is displayed. + +.. image:: static/description/project_form.png + + +Contributors +------------ +* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/project_milestone_estimated_hours/__init__.py b/project_milestone_estimated_hours/__init__.py new file mode 100644 index 00000000..ac4a6864 --- /dev/null +++ b/project_milestone_estimated_hours/__init__.py @@ -0,0 +1,4 @@ +# 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 . import models diff --git a/project_milestone_estimated_hours/__manifest__.py b/project_milestone_estimated_hours/__manifest__.py new file mode 100644 index 00000000..7fdecbd1 --- /dev/null +++ b/project_milestone_estimated_hours/__manifest__.py @@ -0,0 +1,18 @@ +# 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). +{ + "name": "Project Milestone Estimated Hours", + "version": "16.0.1.0.0", + "author": "Numigi", + "maintainer": "Numigi", + "website": "https://bit.ly/numigi-com", + "license": "LGPL-3", + "category": "Project", + "summary": "Add possibility to set estimated hours in a project milestone", + "depends": ["project_milestone_enhanced"], + "data": [ + "views/project_milestone.xml", + "views/project.xml", + ], + "installable": True, +} diff --git a/project_milestone_estimated_hours/i18n/fr.po b/project_milestone_estimated_hours/i18n/fr.po new file mode 100644 index 00000000..4df94eef --- /dev/null +++ b/project_milestone_estimated_hours/i18n/fr.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_milestone_estimated_hours +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-07 04:32+0000\n" +"PO-Revision-Date: 2024-12-07 04:32+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_estimated_hours +#: model:ir.model.fields,field_description:project_milestone_estimated_hours.field_project_milestone__estimated_hours +msgid "Estimated Hours" +msgstr "Heures estimées" + +#. module: project_milestone_estimated_hours +#: model:ir.model,name:project_milestone_estimated_hours.model_project_milestone +msgid "Project Milestone" +msgstr "Jalon" \ No newline at end of file diff --git a/project_milestone_estimated_hours/models/__init__.py b/project_milestone_estimated_hours/models/__init__.py new file mode 100644 index 00000000..4407348d --- /dev/null +++ b/project_milestone_estimated_hours/models/__init__.py @@ -0,0 +1,4 @@ +# 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 . import project_milestone diff --git a/project_milestone_estimated_hours/models/project_milestone.py b/project_milestone_estimated_hours/models/project_milestone.py new file mode 100644 index 00000000..11ad180f --- /dev/null +++ b/project_milestone_estimated_hours/models/project_milestone.py @@ -0,0 +1,10 @@ +# 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 fields, models + + +class ProjectMilestone(models.Model): + _inherit = "project.milestone" + + estimated_hours = fields.Float(string="Estimated Hours") diff --git a/project_milestone_estimated_hours/static/description/icon.png b/project_milestone_estimated_hours/static/description/icon.png new file mode 100644 index 00000000..92a86b10 Binary files /dev/null and b/project_milestone_estimated_hours/static/description/icon.png differ diff --git a/project_milestone_estimated_hours/static/description/project_form.png b/project_milestone_estimated_hours/static/description/project_form.png new file mode 100644 index 00000000..a443dd2a Binary files /dev/null and b/project_milestone_estimated_hours/static/description/project_form.png differ diff --git a/project_milestone_estimated_hours/static/description/project_milestone_copy.png b/project_milestone_estimated_hours/static/description/project_milestone_copy.png new file mode 100644 index 00000000..9474217f Binary files /dev/null and b/project_milestone_estimated_hours/static/description/project_milestone_copy.png differ diff --git a/project_milestone_estimated_hours/static/description/project_milestone_form.png b/project_milestone_estimated_hours/static/description/project_milestone_form.png new file mode 100644 index 00000000..621c793f Binary files /dev/null and b/project_milestone_estimated_hours/static/description/project_milestone_form.png differ diff --git a/project_milestone_estimated_hours/static/description/project_milestone_tree.png b/project_milestone_estimated_hours/static/description/project_milestone_tree.png new file mode 100644 index 00000000..864404a0 Binary files /dev/null and b/project_milestone_estimated_hours/static/description/project_milestone_tree.png differ diff --git a/project_milestone_estimated_hours/tests/__init__.py b/project_milestone_estimated_hours/tests/__init__.py new file mode 100644 index 00000000..2a901ffa --- /dev/null +++ b/project_milestone_estimated_hours/tests/__init__.py @@ -0,0 +1,4 @@ +# 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 . import test_estimated_hours diff --git a/project_milestone_estimated_hours/tests/test_estimated_hours.py b/project_milestone_estimated_hours/tests/test_estimated_hours.py new file mode 100644 index 00000000..90a3f707 --- /dev/null +++ b/project_milestone_estimated_hours/tests/test_estimated_hours.py @@ -0,0 +1,25 @@ +# 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.tests.common import TransactionCase + + +class TestEstimatedHours(TransactionCase): + def setUp(self): + super().setUp() + self.project = self.env["project.project"].create( + {"name": "My Project", "allow_milestones": True} + ) + self.milestone = self.env["project.milestone"].create( + { + "name": "My Milestone", + "estimated_hours": 10, + "project_id": self.project.id, + } + ) + self.milestone_copy = self.milestone.copy() + + def test_estimated_hours_copy(self): + assert ( + self.milestone.estimated_hours == self.milestone_copy.estimated_hours == 10 + ) diff --git a/project_milestone_estimated_hours/views/project.xml b/project_milestone_estimated_hours/views/project.xml new file mode 100644 index 00000000..eb93fcc1 --- /dev/null +++ b/project_milestone_estimated_hours/views/project.xml @@ -0,0 +1,16 @@ + + + + + Project Milestone Estimated Hours Form + project.project + + form + + + + + + + + diff --git a/project_milestone_estimated_hours/views/project_milestone.xml b/project_milestone_estimated_hours/views/project_milestone.xml new file mode 100644 index 00000000..89c21b5e --- /dev/null +++ b/project_milestone_estimated_hours/views/project_milestone.xml @@ -0,0 +1,36 @@ + + + + + Project Milestone Estimated Hours List + project.milestone + + + + + + + + + + + Project Milestone Estimated Hours Form + project.milestone + + + + + + + + + + + + + + + + + +