diff --git a/project_task_code_portal/tests/test_portal.py b/project_task_code_portal/tests/test_portal.py index c927659b8d..fb8df401e3 100644 --- a/project_task_code_portal/tests/test_portal.py +++ b/project_task_code_portal/tests/test_portal.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import re +from urllib.parse import urlparse from lxml import html @@ -47,7 +48,10 @@ def test_portal_tasks_list_access(self): link = tree.xpath(f"//td[a/span[contains(text(), '{self.task_1.name}')]]//a")[ 0 ].attrib["href"] - self.assertEqual(link, self.url_task_code_pattern.format(self.task_1.code)) + self.assertEqual( + urlparse(link), + urlparse(self.url_task_code_pattern.format(self.task_1.code)), + ) def test_portal_task_access(self): self.authenticate("portal", "portal") @@ -83,8 +87,10 @@ def test_portal_task_search_link_format(self): 0 ].attrib["href"] self.assertEqual( - link, - self.url_task_code_pattern.format(self.task_1.code)[:-1] + query_params, + urlparse(link), + urlparse( + self.url_task_code_pattern.format(self.task_1.code)[:-1] + query_params + ), ) def test_portal_task_report(self): @@ -265,7 +271,7 @@ def test_portal_project_tasks_list_access(self): 0 ].attrib["href"] expected_link = f"/my/projects/{project_id}/task/{self.task_3.code}?" - self.assertEqual(link, expected_link) + self.assertEqual(urlparse(link), urlparse(expected_link)) def test_portal_my_project_task_ok(self): self._project_share(access_mode="edit") diff --git a/website_project_task_code/README.rst b/website_project_task_code/README.rst new file mode 100644 index 0000000000..8e000b88ee --- /dev/null +++ b/website_project_task_code/README.rst @@ -0,0 +1,80 @@ +================================================== +Show task code in project task creation in website +================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:76e4bbcc6a15f0cff69d4570934bea72700bc018299abe8e50cd31ec905fcc9d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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/18.0/website_project_task_code + :alt: OCA/project +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-website_project_task_code + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module acts as a glue module to show the task code in the creation +of tasks from website form. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* DixmitAvanzOSC +* Tecnativa + +Contributors +------------ + +- `Dixmit `__ + + - Enric Tobella + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/project `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_project_task_code/__init__.py b/website_project_task_code/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/website_project_task_code/__manifest__.py b/website_project_task_code/__manifest__.py new file mode 100644 index 0000000000..432ac12aa7 --- /dev/null +++ b/website_project_task_code/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2016 Tecnativa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Show task code in project task creation in website", + "version": "18.0.1.0.1", + "category": "Project Management", + "author": "Dixmit" "AvanzOSC, " "Tecnativa, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/project", + "license": "AGPL-3", + "depends": [ + "project_task_code", + "website_project", + ], + "data": [ + "views/templates.xml", + ], +} diff --git a/website_project_task_code/pyproject.toml b/website_project_task_code/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_project_task_code/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_project_task_code/readme/CONTRIBUTORS.md b/website_project_task_code/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..2c066ba7f4 --- /dev/null +++ b/website_project_task_code/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Dixmit](https://www.dixmit.com) + - Enric Tobella diff --git a/website_project_task_code/readme/DESCRIPTION.md b/website_project_task_code/readme/DESCRIPTION.md new file mode 100644 index 0000000000..f5dd714039 --- /dev/null +++ b/website_project_task_code/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module acts as a glue module to show the task code in the creation of tasks from website form. diff --git a/website_project_task_code/static/description/icon.png b/website_project_task_code/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/website_project_task_code/static/description/icon.png differ diff --git a/website_project_task_code/static/description/index.html b/website_project_task_code/static/description/index.html new file mode 100644 index 0000000000..a469a7f0ab --- /dev/null +++ b/website_project_task_code/static/description/index.html @@ -0,0 +1,428 @@ + + + + + +Show task code in project task creation in website + + + +
+

Show task code in project task creation in website

+ + +

Beta License: AGPL-3 OCA/project Translate me on Weblate Try me on Runboat

+

This module acts as a glue module to show the task code in the creation +of tasks from website form.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • DixmitAvanzOSC
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

This module is part of the OCA/project project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/website_project_task_code/views/templates.xml b/website_project_task_code/views/templates.xml new file mode 100644 index 0000000000..88bddea74e --- /dev/null +++ b/website_project_task_code/views/templates.xml @@ -0,0 +1,16 @@ + + + +