Commit 79eb5e74 by Arturo Jasso Origel

se retira codigo de tickets sin evaluar

parent 623a24ce
......@@ -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)
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})
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"})
#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:
# 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:
#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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment