Skip to content

Commit 320e7f1

Browse files
committed
Merge PR #855 into 18.0
Signed-off-by marcelsavegnago
2 parents ae3c551 + 33dd126 commit 320e7f1

2 files changed

Lines changed: 28 additions & 26 deletions

File tree

helpdesk_mgmt/controllers/main.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ def _get_teams(self):
4242

4343
@http.route("/new/ticket", type="http", auth="user", website=True)
4444
def create_new_ticket(self, **kw):
45+
values = self._get_create_new_ticket_values(**kw)
46+
return http.request.render("helpdesk_mgmt.portal_create_ticket", values)
47+
48+
def _get_create_new_ticket_values(self, **kw):
4549
session_info = http.request.env["ir.http"].session_info()
4650
company = request.env.company
4751
category_model = http.request.env["helpdesk.ticket.category"]
@@ -51,22 +55,17 @@ def create_new_ticket(self, **kw):
5155
email = http.request.env.user.email
5256
name = http.request.env.user.name
5357
company = request.env.company
54-
return http.request.render(
55-
"helpdesk_mgmt.portal_create_ticket",
56-
{
57-
"categories": categories,
58-
"teams": self._get_teams(),
59-
"email": email,
60-
"name": name,
61-
"ticket_team_id_required": (
62-
company.helpdesk_mgmt_portal_team_id_required
63-
),
64-
"ticket_category_id_required": (
65-
company.helpdesk_mgmt_portal_category_id_required
66-
),
67-
"max_upload_size": session_info["max_file_upload_size"],
68-
},
69-
)
58+
return {
59+
"categories": categories,
60+
"teams": self._get_teams(),
61+
"email": email,
62+
"name": name,
63+
"ticket_team_id_required": (company.helpdesk_mgmt_portal_team_id_required),
64+
"ticket_category_id_required": (
65+
company.helpdesk_mgmt_portal_category_id_required
66+
),
67+
"max_upload_size": session_info["max_file_upload_size"],
68+
}
7069

7170
def _prepare_submit_ticket_vals(self, **kw):
7271
category = http.request.env["helpdesk.ticket.category"].browse(

helpdesk_mgmt/views/helpdesk_ticket_templates.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@
9494
<tr
9595
t-attf-class="{{'thead-light' if not groupby == 'none' else ''}}"
9696
>
97-
<th class="text-left">By</th>
98-
<th class="text-left">Number</th>
99-
<th t-if="groupby == 'none'">Title</th>
100-
<th t-if="groupby == 'category'">
97+
<th name="th_partner" class="text-left">By</th>
98+
<th name="th_number" class="text-left">Number</th>
99+
<th name="th_ticket" t-if="groupby == 'none'">Title</th>
100+
<th name="th_groupby_category" t-if="groupby == 'category'">
101101
<em
102102
class="font-weight-normal text-muted"
103103
>Tickets in category:</em>
@@ -106,7 +106,7 @@
106106
t-field="tickets[0].sudo().category_id.complete_name"
107107
/>
108108
</th>
109-
<th t-if="groupby == 'stage'">
109+
<th name="th_groupby_stage" t-if="groupby == 'stage'">
110110
<em
111111
class="font-weight-normal text-muted"
112112
>Tickets in stage:</em>
@@ -115,11 +115,14 @@
115115
t-field="tickets[0].sudo().stage_id.name"
116116
/>
117117
</th>
118-
<th t-if="groupby != 'category'">Category</th>
119-
<th t-if="groupby != 'stage'">Stage</th>
120-
<th>Create Date</th>
121-
<th>Last Stage Update</th>
122-
<th>Close Date</th>
118+
<th
119+
name="th_category"
120+
t-if="groupby != 'category'"
121+
>Category</th>
122+
<th name="th_stage" t-if="groupby != 'stage'">Stage</th>
123+
<th name="th_create_date">Create Date</th>
124+
<th name="th_last_stage_update">Last Stage Update</th>
125+
<th name="th_closed_date">Close Date</th>
123126
</tr>
124127
</thead>
125128
<tbody>

0 commit comments

Comments
 (0)