diff --git a/support_server/README.rst b/support_server/README.rst new file mode 100644 index 00000000..fafdf535 --- /dev/null +++ b/support_server/README.rst @@ -0,0 +1,55 @@ +============== +Support Server +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:18861518067acb1a2dba5090096f6b0d6613853689ca8362249a6d62f66298b2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-Akretion%2Fsupport-lightgray.png?logo=github + :target: https://github.com/Akretion/support/tree/18.0/support_server + :alt: Akretion/support + +|badge1| |badge2| |badge3| + +Support Server + +**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 +------- + +* Akretion + +Maintainers +----------- + +This module is part of the `Akretion/support `_ project on GitHub. + +You are welcome to contribute. diff --git a/support_server/__init__.py b/support_server/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/support_server/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/support_server/__manifest__.py b/support_server/__manifest__.py new file mode 100644 index 00000000..22a8d2f4 --- /dev/null +++ b/support_server/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2025 Akretion (http://www.akretion.com). +# @author Florian Mounier +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Support Server", + "summary": "Provide cross connect server support integration", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "Akretion", + "website": "https://github.com/akretion/support", + "depends": [ + "cross_connect_server", + "project_customer_access", + ], + "data": [], +} diff --git a/support_server/models/__init__.py b/support_server/models/__init__.py new file mode 100644 index 00000000..a4a6b5ac --- /dev/null +++ b/support_server/models/__init__.py @@ -0,0 +1,2 @@ +from . import cross_connect_client +from . import project_task diff --git a/support_server/models/cross_connect_client.py b/support_server/models/cross_connect_client.py new file mode 100644 index 00000000..796c99a9 --- /dev/null +++ b/support_server/models/cross_connect_client.py @@ -0,0 +1,35 @@ +# Copyright 2025 Akretion (http://www.akretion.com). +# @author Florian Mounier +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from urllib.parse import urlencode + +from odoo import models +from odoo.http import request + + +class CrossConnectClient(models.Model): + _inherit = "cross.connect.client" + + def _get_final_redirect_url(self, **params): + """Redirect to project_customer_access with set form default values.""" + url = super()._get_final_redirect_url(**params) + redirect_params = {} + if params.get("bypass"): + redirect_params["action"] = "project.action_view_task" + else: + redirect_params["action"] = "project_customer_access.action_view_all_task" + + if params.get("intent") == "new": + session = params.get("session") or request.session + if session: + session.support_default_params = { + field: params.get(field) + for field in ("origin_db", "origin_name", "origin_url") + } + + redirect_params.update( + { + "view_type": "form", + } + ) + return f"{url}#{urlencode(redirect_params)}" diff --git a/support_server/models/project_task.py b/support_server/models/project_task.py new file mode 100644 index 00000000..40a543a4 --- /dev/null +++ b/support_server/models/project_task.py @@ -0,0 +1,19 @@ +# Copyright 2026 Akretion (http://www.akretion.com). +# @author Florian Mounier +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import api, models +from odoo.http import request + + +class ProjectTask(models.Model): + _inherit = "project.task" + + @api.model + def default_get(self, fields_list): + defaults = super().default_get(fields_list) + session = request.session + if session and session.get("support_default_params"): + defaults.update(session.pop("support_default_params")) + return defaults diff --git a/support_server/pyproject.toml b/support_server/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/support_server/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/support_server/readme/DESCRIPTION.md b/support_server/readme/DESCRIPTION.md new file mode 100644 index 00000000..046ae001 --- /dev/null +++ b/support_server/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Support Server diff --git a/support_server/static/description/index.html b/support_server/static/description/index.html new file mode 100644 index 00000000..f5e5ecb7 --- /dev/null +++ b/support_server/static/description/index.html @@ -0,0 +1,409 @@ + + + + + +Support Server + + + +
+

Support Server

+ + +

Beta License: AGPL-3 Akretion/support

+

Support Server

+

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

+
    +
  • Akretion
  • +
+
+
+

Maintainers

+

This module is part of the Akretion/support project on GitHub.

+

You are welcome to contribute.

+
+
+
+ +