Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Arturo Jasso Origel
/
helpdesk
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bdc5b07e
authored
Jun 19, 2023
by
Arturo Jasso Origel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se agregan botones para que el usuario pueda cerrar y cancelar su ticket
parent
7010b720
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
12 deletions
+114
-12
helpdesk_morsa/controllers/portal.py
+35
-2
helpdesk_morsa/controllers/portal_soporte.py
+3
-0
helpdesk_morsa/models/helpdesk_ticket.py
+1
-1
helpdesk_morsa/views/portal/portal_page.xml
+75
-9
No files found.
helpdesk_morsa/controllers/portal.py
View file @
bdc5b07e
...
@@ -81,4 +81,37 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
...
@@ -81,4 +81,37 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
"Favor de agregar un contacto valido"
})
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
"Favor de agregar un contacto valido"
})
except
Exception
as
e
:
except
Exception
as
e
:
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
str
(
e
),
"unvalued"
:[]})
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
str
(
e
),
"unvalued"
:[]})
\ No newline at end of file
@http.route
([
'/cerrar-ticket'
],
type
=
'http'
,
auth
=
"user"
,
website
=
True
)
def
portal_ticket_closed
(
self
,
**
kw
):
url
=
"/my"
if
kw
.
get
(
'option'
):
url
=
"/my/"
+
kw
.
get
(
'option'
)
+
"?ctr=False"
try
:
ticket
=
request
.
env
[
'helpdesk.ticket'
]
.
sudo
()
.
browse
(
int
(
kw
.
get
(
'ticket_id'
)))
if
ticket
:
ticket
.
sudo
()
.
update
({
'descripcion_solution'
:
"Cerrado por el usuario"
})
ticket
.
sudo
()
.
done_and_close
()
except
Exception
as
e
:
_logger
.
exception
(
'Something went wrong
%
s'
,
str
(
e
))
finally
:
return
request
.
redirect
(
url
)
@http.route
([
'/cancel-ticket'
],
type
=
'http'
,
auth
=
"user"
,
website
=
True
)
def
portal_ticket_cancel
(
self
,
**
kw
):
url
=
"/my"
if
kw
.
get
(
'option'
):
url
=
"/my/"
+
kw
.
get
(
'option'
)
+
"?ctr=False"
try
:
ticket
=
request
.
env
[
'helpdesk.ticket'
]
.
sudo
()
.
browse
(
int
(
kw
.
get
(
'ticket_id'
)))
if
ticket
:
ticket
.
sudo
()
.
action_cancel
()
except
Exception
as
e
:
_logger
.
exception
(
'Something went wrong
%
s'
,
str
(
e
))
finally
:
return
request
.
redirect
(
url
)
\ No newline at end of file
helpdesk_morsa/controllers/portal_soporte.py
View file @
bdc5b07e
...
@@ -445,3 +445,6 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
...
@@ -445,3 +445,6 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
'report_type'
:
'html'
,
'report_type'
:
'html'
,
}
}
return
request
.
render
(
"helpdesk_morsa.portal_ticket_page_support"
,
values
)
return
request
.
render
(
"helpdesk_morsa.portal_ticket_page_support"
,
values
)
helpdesk_morsa/models/helpdesk_ticket.py
View file @
bdc5b07e
...
@@ -412,7 +412,7 @@ class HelpdeskTicket(models.Model):
...
@@ -412,7 +412,7 @@ class HelpdeskTicket(models.Model):
if
vals
[
'team_id'
]
in
[
self
.
env
.
ref
(
'helpdesk_morsa.techinnical_support'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.erp_asistense'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.ti_emergency'
)
.
id
]:
if
vals
[
'team_id'
]
in
[
self
.
env
.
ref
(
'helpdesk_morsa.techinnical_support'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.erp_asistense'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.ti_emergency'
)
.
id
]:
if
self
.
team_id
.
id
not
in
[
self
.
env
.
ref
(
'helpdesk_morsa.support_second_level'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.support_third_level'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.purchase_actives'
)
.
id
]:
if
self
.
team_id
.
id
not
in
[
self
.
env
.
ref
(
'helpdesk_morsa.support_second_level'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.support_third_level'
)
.
id
,
self
.
env
.
ref
(
'helpdesk_morsa.purchase_actives'
)
.
id
]:
vals
.
update
({
'name'
:
self
.
env
[
'ir.sequence'
]
.
sudo
()
.
next_by_code
(
'helpdesk.ticket.'
+
str
(
vals
[
'team_id'
])
or
_
(
'New'
))})
vals
.
update
({
'name'
:
self
.
env
[
'ir.sequence'
]
.
sudo
()
.
next_by_code
(
'helpdesk.ticket.'
+
str
(
vals
[
'team_id'
])
or
_
(
'New'
))})
if
"stage_id"
in
vals
:
if
"stage_id"
in
vals
and
self
.
env
.
ref
(
'sh_all_in_one_helpdesk.cancel_stage'
)
.
id
!=
vals
[
'stage_id'
]
:
if
self
.
is_support
==
True
:
if
self
.
is_support
==
True
:
if
self
.
description
==
'<p><br></p>'
or
self
.
description
==
False
:
if
self
.
description
==
'<p><br></p>'
or
self
.
description
==
False
:
raise
ValidationError
(
_
(
"Para cambiar de etapa, es necesario agregar una descripción"
))
raise
ValidationError
(
_
(
"Para cambiar de etapa, es necesario agregar una descripción"
))
...
...
helpdesk_morsa/views/portal/portal_page.xml
View file @
bdc5b07e
...
@@ -62,9 +62,31 @@
...
@@ -62,9 +62,31 @@
<!-- Intro -->
<!-- Intro -->
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<h2
class=
"my-0"
>
<div
class=
"row"
>
<strong><em
t-esc=
"soporte.name"
/></strong>
<div
class=
"col-sm-12 col-md-6 col-lg-6"
>
</h2>
<h2
class=
"my-0"
>
<strong><em
t-esc=
"soporte.name"
/></strong>
</h2>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-6 text-right"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 col-md-6 col-lg-8"
>
<form
action=
"/cerrar-ticket"
t-if=
"soporte.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"soporte"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"soporte.id"
/>
<button
type=
"submit"
id=
"close_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cerrar Ticket
</button>
</form>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-4"
>
<form
action=
"/cancel-ticket"
t-if=
"soporte.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"soporte"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"soporte.id"
/>
<button
type=
"submit"
id=
"cancle_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cancelar Ticket
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
id=
"informations"
>
<div
id=
"informations"
>
...
@@ -336,9 +358,31 @@
...
@@ -336,9 +358,31 @@
<!-- Intro -->
<!-- Intro -->
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<h2
class=
"my-0"
>
<div
class=
"row"
>
<strong><em
t-esc=
"asistencia.name"
/></strong>
<div
class=
"col-sm-12 col-md-6 col-lg-6"
>
</h2>
<h2
class=
"my-0"
>
<strong><em
t-esc=
"asistencia.name"
/></strong>
</h2>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-6 text-right"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 col-md-6 col-lg-8"
>
<form
action=
"/cerrar-ticket"
t-if=
"asistencia.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"erp"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"asistencia.id"
/>
<button
type=
"submit"
id=
"close_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cerrar Ticket
</button>
</form>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-4"
>
<form
action=
"/cancel-ticket"
t-if=
"asistencia.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"erp"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"asistencia.id"
/>
<button
type=
"submit"
id=
"cancle_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cancelar Ticket
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
id=
"informations"
>
<div
id=
"informations"
>
...
@@ -724,9 +768,31 @@
...
@@ -724,9 +768,31 @@
<!-- Intro -->
<!-- Intro -->
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<div
id=
"introduction"
t-attf-class=
"pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
>
<h2
class=
"my-0"
>
<div
class=
"row"
>
<strong><em
t-esc=
"ti.name"
/></strong>
<div
class=
"col-sm-12 col-md-6 col-lg-6"
>
</h2>
<h2
class=
"my-0"
>
<strong><em
t-esc=
"ti.name"
/></strong>
</h2>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-6 text-right"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 col-md-6 col-lg-8"
>
<form
action=
"/cerrar-ticket"
t-if=
"ti.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"911"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"ti.id"
/>
<button
type=
"submit"
id=
"close_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cerrar Ticket
</button>
</form>
</div>
<div
class=
"col-sm-12 col-md-6 col-lg-4"
>
<form
action=
"/cancel-ticket"
t-if=
"ti.stage_id.name not in ['Hecho','Cerrado','Cancelado']"
class=
"oe_inline"
>
<input
type=
"hidden"
name=
"option"
id=
"option"
value=
"911"
/>
<input
type=
"hidden"
name=
"ticket_id"
id=
"ticket_id"
t-att-value=
"ti.id"
/>
<button
type=
"submit"
id=
"cancle_ticket"
class=
"btn btn-primary mt-2 rounded"
>
Cancelar Ticket
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
t-attf-class=
"#{'card-body' if report_type == 'html' else ''}"
>
<div
id=
"informations"
>
<div
id=
"informations"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment