forked from OCA/project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Numigi/numigi-project_milestone_estimated_…
…hours [14.0][ADD] project_milestone_estimated_hours
- Loading branch information
Showing
17 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
project_milestone_estimated_hours/models/project_milestone.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Binary file added
BIN
+51.4 KB
project_milestone_estimated_hours/static/description/project_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49 KB
project_milestone_estimated_hours/static/description/project_milestone_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.4 KB
project_milestone_estimated_hours/static/description/project_milestone_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.6 KB
project_milestone_estimated_hours/static/description/project_milestone_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
project_milestone_estimated_hours/tests/test_estimated_hours.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
31
project_milestone_estimated_hours/views/project_milestone.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
1 change: 1 addition & 0 deletions
1
setup/project_milestone_estimated_hours/odoo/addons/project_milestone_estimated_hours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../project_milestone_estimated_hours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |