Skip to content

Commit 5b532ab

Browse files
committed
[IMP] support: Work with params and not server redirect_url
1 parent ba2f91a commit 5b532ab

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

support/models/cross_connect_server.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Copyright 2025 Akretion (http://www.akretion.com).
22
# @author Florian Mounier <florian.mounier@akretion.com>
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4-
import re
4+
from urllib.parse import urlencode
55

66
from odoo import api, models
7-
from urllib.parse import urlencode, urlparse
8-
9-
AKRETION_EMAILS_RE = re.compile(r"^(.*@akretion\.com(\.br)?)$")
107

118

129
class CrossConnectServer(models.Model):
@@ -53,29 +50,8 @@ def redirect_to_support(self):
5350

5451
params["origin_url"] += f"/web#{urlencode(url_params)}"
5552

56-
redirect_params = {
57-
"action": "project_customer_access.action_view_all_task",
58-
"view_type": "form",
59-
**{
60-
f"project.task_default_{field}": value
61-
for field, value in params.items()
62-
},
63-
}
64-
65-
final_params = {"redirect_url": f"/web#{urlencode(redirect_params)}"}
66-
url += "?" + urlencode(final_params)
53+
url += "?" + urlencode(params)
6754

68-
# Akretion users specific case
69-
if self.env.user.email and AKRETION_EMAILS_RE.match(self.env.user.email):
70-
redirect_params["action"] = (
71-
"project.action_view_task"
72-
)
73-
server_url = urlparse(server.server_url)
74-
server_url = server_url._replace(
75-
path="/web",
76-
fragment=urlencode(redirect_params),
77-
)
78-
url = server_url.geturl()
7955
return {
8056
"type": "ir.actions.act_url",
8157
"url": url,

0 commit comments

Comments
 (0)