-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] project_task_add_very_high: Migration to 18.0
- Loading branch information
1 parent
4047123
commit 503f036
Showing
6 changed files
with
96 additions
and
15 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 |
---|---|---|
|
@@ -17,13 +17,13 @@ Project Task Add Very High | |
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github | ||
:target: https://github.com/OCA/project/tree/17.0/project_task_add_very_high | ||
:target: https://github.com/OCA/project/tree/18.0/project_task_add_very_high | ||
:alt: OCA/project | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_task_add_very_high | ||
:target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_add_very_high | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=17.0 | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
@@ -82,7 +82,7 @@ Bug Tracker | |
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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/OCA/project/issues/new?body=module:%20project_task_add_very_high%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_add_very_high%0Aversion:%2018.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. | ||
|
||
|
@@ -97,8 +97,9 @@ Authors | |
Contributors | ||
------------ | ||
|
||
- Andrea Stirpe <[email protected]> | ||
- Yves Goldberg (Ygol InternetWork) [email protected] | ||
- Andrea Stirpe <[email protected]> | ||
- Yves Goldberg (Ygol InternetWork) [email protected] | ||
- ``Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>``\ \_ | ||
|
||
Maintainers | ||
----------- | ||
|
@@ -121,6 +122,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | |
|
||
|maintainer-astirpe| | ||
|
||
This module is part of the `OCA/project <https://github.com/OCA/project/tree/17.0/project_task_add_very_high>`_ project on GitHub. | ||
This module is part of the `OCA/project <https://github.com/OCA/project/tree/18.0/project_task_add_very_high>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Andrea Stirpe \<<[email protected]>\> | ||
- Yves Goldberg (Ygol InternetWork) <[email protected]> | ||
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`_ |
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 |
---|---|---|
|
@@ -8,10 +8,11 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
: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. | ||
|
@@ -274,7 +275,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: grey; } /* line numbers */ | ||
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 } | ||
|
@@ -300,7 +301,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic { | ||
span.problematic, pre.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -368,7 +369,7 @@ <h1 class="title">Project Task Add Very High</h1> | |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:ae55a9b6aa58ebee08506e9cf834e58d37bc6cae4e77fab50c4963138e9c730e | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/OCA/project/tree/17.0/project_task_add_very_high"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_task_add_very_high"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> | ||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/OCA/project/tree/18.0/project_task_add_very_high"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_add_very_high"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> | ||
<p>This module extends the field priority in project tasks, adding two new | ||
levels of priority. The two new levels of priority are: High and Very | ||
High.</p> | ||
|
@@ -415,7 +416,7 @@ <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/OCA/project/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/OCA/project/issues/new?body=module:%20project_task_add_very_high%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> | ||
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_task_add_very_high%0Aversion:%2018.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"> | ||
|
@@ -431,18 +432,21 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2> | |
<ul class="simple"> | ||
<li>Andrea Stirpe <<a class="reference external" href="mailto:a.stirpe@onestein.nl">a.stirpe@onestein.nl</a>></li> | ||
<li>Yves Goldberg (Ygol InternetWork) <a class="reference external" href="mailto:yves@ygol.com">yves@ygol.com</a></li> | ||
<li><tt class="docutils literal">Heliconia Solutions Pvt. Ltd. <span class="pre"><https://www.heliconia.io></span></tt>_</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2> | ||
<p>This module is maintained by the OCA.</p> | ||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> | ||
<a class="reference external image-reference" href="https://odoo-community.org"> | ||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> | ||
</a> | ||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use.</p> | ||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> | ||
<p><a class="reference external image-reference" href="https://github.com/astirpe"><img alt="astirpe" src="https://github.com/astirpe.png?size=40px" /></a></p> | ||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/17.0/project_task_add_very_high">OCA/project</a> project on GitHub.</p> | ||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/18.0/project_task_add_very_high">OCA/project</a> project on GitHub.</p> | ||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> | ||
</div> | ||
</div> | ||
|
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 @@ | ||
from . import test_project_task |
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,74 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestProjectTaskPriority(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
self.project_task_model = self.env["project.task"] | ||
|
||
def test_priority_selection(self): | ||
"""Test that the priority field includes the new options.""" | ||
# Get the priority field definition | ||
priority_field = self.project_task_model.fields_get(allfields=["priority"])[ | ||
"priority" | ||
] | ||
|
||
# Verify the new priority options are included | ||
expected_options = [("2", "Very High"), ("3", "Most Important")] | ||
for option in expected_options: | ||
self.assertIn( | ||
option, | ||
priority_field["selection"], | ||
f"{option} not found in priority selection", | ||
) | ||
|
||
def test_create_task_with_new_priority(self): | ||
"""Test creating tasks with the new priorities.""" | ||
# Create a task with the new priority "Very High" | ||
task = self.project_task_model.create( | ||
{ | ||
"name": "Test Very High Priority Task", | ||
"priority": "2", | ||
} | ||
) | ||
self.assertEqual(task.priority, "2", "Task priority should be '2' (Very High)") | ||
|
||
# Create a task with the new priority "Most Important" | ||
task = self.project_task_model.create( | ||
{ | ||
"name": "Test Most Important Priority Task", | ||
"priority": "3", | ||
} | ||
) | ||
self.assertEqual( | ||
task.priority, "3", "Task priority should be '3' (Most Important)" | ||
) | ||
|
||
def test_update_priority(self): | ||
"""Test updating task priority.""" | ||
# Create a task with a default priority | ||
task = self.project_task_model.create({"name": "Test Task"}) | ||
self.assertEqual(task.priority, "0", "Default task priority should be '0'") | ||
|
||
# Update the priority to "Very High" | ||
task.write({"priority": "2"}) | ||
self.assertEqual( | ||
task.priority, "2", "Task priority should be updated to '2' (Very High)" | ||
) | ||
|
||
# Update the priority to "Most Important" | ||
task.write({"priority": "3"}) | ||
self.assertEqual( | ||
task.priority, | ||
"3", | ||
"Task priority should be updated to '3' (Most Important)", | ||
) | ||
|
||
def test_invalid_priority(self): | ||
"""Test that an invalid priority value raises an error.""" | ||
with self.assertRaises( | ||
ValueError, msg="Invalid priority should raise ValueError" | ||
): | ||
self.project_task_model.create( | ||
{"name": "Invalid Priority Task", "priority": "99"} | ||
) |