|
1 | 1 | # Copyright 2025 Akretion (http://www.akretion.com). |
2 | 2 | # @author Florian Mounier <florian.mounier@akretion.com> |
3 | 3 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
4 | | -import re |
| 4 | +from urllib.parse import urlencode |
5 | 5 |
|
6 | 6 | from odoo import api, models |
7 | | -from urllib.parse import urlencode, urlparse |
8 | | - |
9 | | -AKRETION_EMAILS_RE = re.compile(r"^(.*@akretion\.com(\.br)?)$") |
10 | 7 |
|
11 | 8 |
|
12 | 9 | class CrossConnectServer(models.Model): |
@@ -53,29 +50,8 @@ def redirect_to_support(self): |
53 | 50 |
|
54 | 51 | params["origin_url"] += f"/web#{urlencode(url_params)}" |
55 | 52 |
|
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) |
67 | 54 |
|
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() |
79 | 55 | return { |
80 | 56 | "type": "ir.actions.act_url", |
81 | 57 | "url": url, |
|
0 commit comments