Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] project_milestone_estimated_hours #3

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions project_milestone_estimated_hours/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Project Milestone Estimated Hours
=================================

.. contents:: Table of Contents

Context
-------
The module `project_milestone <https://github.com/OCA/project/tree/14.0/project_milestone>`_ 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)
4 changes: 4 additions & 0 deletions project_milestone_estimated_hours/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 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
18 changes: 18 additions & 0 deletions project_milestone_estimated_hours/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# © 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": "14.0.1.0.0",
"author": "Numigi, Odoo Community Association (OCA)",
"maintainer": "Numigi",
"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"category": "Project",
"summary": "Add possibility to set estimated hours in a project milestone",
"depends": ["project_milestone"],
"data": [
"views/project_milestone.xml",
"views/project.xml",
],
"installable": True,
}
27 changes: 27 additions & 0 deletions project_milestone_estimated_hours/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_milestone_estimated_hours
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-03 11:46+0000\n"
"PO-Revision-Date: 2022-03-03 11:46+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"

4 changes: 4 additions & 0 deletions project_milestone_estimated_hours/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 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
10 changes: 10 additions & 0 deletions project_milestone_estimated_hours/models/project_milestone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# © 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")
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_milestone_estimated_hours/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 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
19 changes: 19 additions & 0 deletions project_milestone_estimated_hours/tests/test_estimated_hours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# © 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 SavepointCase


class TestEstimatedHours(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.milestone = cls.env["project.milestone"].create(
{"name": "My Milestone", "estimated_hours": 10}
)
cls.milestone_copy = cls.milestone.copy()

def test_estimated_hours_copy(self):
assert (
self.milestone.estimated_hours == self.milestone_copy.estimated_hours == 10
)
22 changes: 22 additions & 0 deletions project_milestone_estimated_hours/views/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Form View -->
<record id="project_milestone_estimated_hours_view_form" model="ir.ui.view">
<field name="name">Project Milestone Estimated Hours Form</field>
<field name="model">project.project</field>
<field
name="inherit_id"
ref="project_milestone.project_enhancement_milestone_view_inherit_form"
/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath
expr="//page[@name='milestone_ids']/group/field[@name='milestone_ids']/tree/field[@name='project_task_ids']"
position="after"
>
<field name="estimated_hours" />
</xpath>
</field>
</record>

</odoo>
31 changes: 31 additions & 0 deletions project_milestone_estimated_hours/views/project_milestone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- List View-->
<record id="project_milestone_estimated_hours_view_list" model="ir.ui.view">
<field name="name">Project Milestone Estimated Hours List</field>
<field name="model">project.milestone</field>
<field name="inherit_id" ref="project_milestone.project_milestone_view_list" />
<field name="arch" type="xml">
<field name="project_task_ids" position="after">
<field name="estimated_hours" widget="float_time" />
</field>
</field>
</record>

<!-- Form View -->
<record id="project_milestone_estimated_hours_form" model="ir.ui.view">
<field name="name">Project Milestone Estimated Hours Form</field>
<field name="model">project.milestone</field>
<field name="inherit_id" ref="project_milestone.project_milestone_view_form" />
<field name="arch" type="xml">
<xpath expr="//group" position="before">
<group>
<group>
<field name="estimated_hours" widget="float_time" />
</group>
</group>
</xpath>
</field>
</record>

</odoo>
6 changes: 6 additions & 0 deletions setup/project_milestone_estimated_hours/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading