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
79eb5e74
authored
Jun 26, 2023
by
Arturo Jasso Origel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se retira codigo de tickets sin evaluar
parent
623a24ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
helpdesk_morsa/controllers/portal.py
+29
-27
No files found.
helpdesk_morsa/controllers/portal.py
View file @
79eb5e74
...
...
@@ -50,37 +50,39 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
@http.route
([
'/unvaluated/tickets'
],
type
=
'http'
,
auth
=
"none"
,
website
=
True
,
csrf
=
False
)
def
verify_unvaluated_tikets
(
self
,
**
kw
):
try
:
partner_id
=
False
if
kw
.
get
(
'partner_id'
)
and
kw
.
get
(
'partner_id'
)
!=
''
:
partner_id
=
request
.
env
[
'res.partner'
]
.
sudo
()
.
search
([(
'id'
,
'='
,
int
(
kw
.
get
(
'partner_id'
)))],
limit
=
1
)
elif
kw
.
get
(
'portal_email'
)
and
kw
.
get
(
'portal_email'
)
!=
''
:
partner_id
=
request
.
env
[
'res.partner'
]
.
sudo
()
.
search
([(
'email'
,
'='
,
kw
.
get
(
'portal_email'
))],
limit
=
1
)
return
json
.
dumps
({
"resp"
:
"Success"
,
"message"
:
""
,
"unvalued"
:[]})
#partner_id = False
#if kw.get('partner_id') and kw.get('partner_id') != '':
# partner_id = request.env['res.partner'].sudo().search([('id','=',int(kw.get('partner_id')))],limit=1)
#elif kw.get('portal_email') and kw.get('portal_email') != '':
# partner_id = request.env['res.partner'].sudo().search([('email','=',kw.get('portal_email'))],limit=1)
if
partner_id
:
#
if partner_id:
unvalued_tickets
=
request
.
env
[
'helpdesk.ticket'
]
.
sudo
()
.
search
([
(
'partner_id'
,
'='
,
partner_id
.
id
),
(
'team_id'
,
'='
,
request
.
env
.
ref
(
'helpdesk_morsa.techinnical_support'
)
.
id
),
(
'stage_id'
,
'='
,
request
.
env
.
ref
(
'sh_all_in_one_helpdesk.close_stage'
)
.
id
),
(
'priority_new'
,
'='
,
False
)])
if
len
(
unvalued_tickets
)
>=
10
:
unvalued
=
[]
for
t
in
unvalued_tickets
:
unvalued
.
append
({
't_id'
:
t
.
id
,
't_name'
:
t
.
name
})
# unvalued_tickets = request.env['helpdesk.ticket'].sudo().search([
# ('partner_id','=',partner_id.id),
# ('team_id','=',request.env.ref('helpdesk_morsa.techinnical_support').id),
# ('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.close_stage').id),
# ('priority_new','=',False)])
# if len(unvalued_tickets) >= 10:
# unvalued = []
# for t in unvalued_tickets:
# unvalued.append({'t_id': t.id, 't_name' : t.name})
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
"Tienes demasiados tickets sin evaluar, favor de evaluarlos"
,
"unvalued"
:
unvalued
})
else
:
return
json
.
dumps
({
"resp"
:
"Success"
,
"message"
:
""
,
"unvalued"
:[]})
else
:
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
"Favor de agregar un contacto valido"
})
#
return json.dumps({
#
"resp":"Error",
#
"message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos",
#
"unvalued":unvalued
#
})
#
else:
#
else:
#
return json.dumps({"resp":"Error","message":"Favor de agregar un contacto valido"})
except
Exception
as
e
:
return
json
.
dumps
({
"resp"
:
"Error"
,
"message"
:
str
(
e
),
"unvalued"
:[]})
return
json
.
dumps
({
"resp"
:
"Success"
,
"message"
:
""
,
"unvalued"
:[]})
@http.route
([
'/cerrar-ticket'
],
type
=
'http'
,
auth
=
"user"
,
website
=
True
)
def
portal_ticket_closed
(
self
,
**
kw
):
...
...
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