Commit f07eba6a by Arturo Jasso Origel

se agregaron correcciones en la asinacón de correo al conactgito,se retiro el…

se agregaron correcciones en la asinacón de correo al conactgito,se retiro el código que se encargaba de verificar los tickets sin valorar y se agrego otro en python como en el javascript,  se agrego el campo de descripción de solución en las vistas del ticket, se corrigieron unos detalles en las vistas de la mesa de ayuda, además que se retiro la restricción del 911
parent 64b18b07
...@@ -49,7 +49,7 @@ class PortalHelpdeskMorsa(PortalHelpdesk): ...@@ -49,7 +49,7 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
@http.route(['/unvaluated/tickets'],type='http',auth="none",website=True,csrf=False) @http.route(['/unvaluated/tickets'],type='http',auth="none",website=True,csrf=False)
def verify_unvaluated_tikets(self,**kw): def verify_unvaluated_tikets(self,**kw):
try:
partner_id = False partner_id = False
if kw.get('partner_id') and kw.get('partner_id') != '': 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) partner_id = request.env['res.partner'].sudo().search([('id','=',int(kw.get('partner_id')))],limit=1)
...@@ -58,19 +58,28 @@ class PortalHelpdeskMorsa(PortalHelpdesk): ...@@ -58,19 +58,28 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
if partner_id: if partner_id:
unvalued_tickets = len( unvalued_tickets = request.env['helpdesk.ticket'].sudo().search([
request.env['helpdesk.ticket'].sudo().search([('partner_id','=',partner_id.id), ('partner_id','=',partner_id.id),
('team_id','=',request.env.ref('helpdesk_morsa.techinnical_support').id), ('team_id','=',request.env.ref('helpdesk_morsa.techinnical_support').id),
('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.close_stage').id), ('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.close_stage').id),
('priority_new','=',False)]) ('priority_new','=',False)])
)
if unvalued_tickets >= 3:
return json.dumps({"resp":"Error","message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos"}) _logger.info(unvalued_tickets)
else:
return json.dumps({"resp":"Success","message":""}) if len(unvalued_tickets) >= 3:
else: 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":"Favor de agregar un contacto valido"})
except Exception as e:
return json.dumps({"resp":"Error","message":str(e),"unvalued":[]})
\ No newline at end of file
...@@ -356,15 +356,8 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk): ...@@ -356,15 +356,8 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk):
partner_id = request.env.user.partner_id partner_id = request.env.user.partner_id
if not partner_id: if not partner_id:
return json.dumps({"resp":"Error","message":"Colaborador no encontrado, favor de verificar que haya agregado uno"}) return request.redirect("/my/911")
if partner_id: if partner_id:
#unvalued_tickets = len(
# request.env['helpdesk.ticket'].sudo().search([
# ('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.done_stage').id),
# ('priority_new','=',False)])
# )
#if unvalued_tickets >= 3:
# return json.dumps({"resp":"Error","message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos"})
ticket_dic = { ticket_dic = {
'partner_id': partner_id.id, 'partner_id': partner_id.id,
'ticket_from_portal': True 'ticket_from_portal': True
......
...@@ -375,15 +375,9 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -375,15 +375,9 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
partner_id = request.env.user.partner_id partner_id = request.env.user.partner_id
if not partner_id: if not partner_id:
return json.dumps({"resp":"Error","message":"Colaborador no encontrado, favor de verificar que haya agregado uno"}) return request.redirect("/my/erp")
if partner_id: if partner_id:
#unvalued_tickets = len(
# request.env['helpdesk.ticket'].sudo().search([
# ('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.done_stage').id),
# ('priority_new','=',False)])
# )
#if unvalued_tickets >= 3:
# return json.dumps({"resp":"Error","message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos"})
ticket_dic = { ticket_dic = {
'partner_id': partner_id.id, 'partner_id': partner_id.id,
'ticket_from_portal': True 'ticket_from_portal': True
...@@ -429,7 +423,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -429,7 +423,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
'erp_id':portal_module_id.id 'erp_id':portal_module_id.id
}) })
elif kw.get('portal_erp_type') == 'mejora': elif kw.get('portal_erp_type') in ['mejora','reporte']:
if kw.get('portal_route'): if kw.get('portal_route'):
ticket_dic.update({ ticket_dic.update({
'module_route': kw.get('portal_route') 'module_route': kw.get('portal_route')
...@@ -458,13 +452,6 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -458,13 +452,6 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
'erp_id':portal_module_id.id 'erp_id':portal_module_id.id
}) })
if 'portal_file' not in request.params and 'portal_file_mejora' not in request.params:
return json.dumps({"resp":"Error","message":"Es necesario agregar la archivos"})
else:
return json.dumps({"resp":"Error","message":"El tipo de ticket no se encuentra dentro de los valores"})
else:
return json.dumps({"resp":"Error","message":"No existe tipo de ticket"})
ticket_id = request.env['helpdesk.ticket'].sudo().create( ticket_id = request.env['helpdesk.ticket'].sudo().create(
ticket_dic) ticket_dic)
...@@ -483,6 +470,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -483,6 +470,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
}) })
attachment_ids.append(attachment_id.id) attachment_ids.append(attachment_id.id)
ticket_id.attachment_ids = [(6, 0, attachment_ids)] ticket_id.attachment_ids = [(6, 0, attachment_ids)]
if 'portal_file_mejora' in request.params : if 'portal_file_mejora' in request.params :
attached_files = request.httprequest.files.getlist('portal_file_mejora') attached_files = request.httprequest.files.getlist('portal_file_mejora')
attachment_ids = [] attachment_ids = []
......
...@@ -358,15 +358,9 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk): ...@@ -358,15 +358,9 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
partner_id = request.env.user.partner_id partner_id = request.env.user.partner_id
if not partner_id: if not partner_id:
return json.dumps({"resp":"Error","message":"Colaborador no encontrado, favor de verificar que haya agregado uno"}) return request.redirect("/my/soporte")
if partner_id: if partner_id:
#unvalued_tickets = len(
# request.env['helpdesk.ticket'].sudo().search([
# ('stage_id','=',request.env.ref('sh_all_in_one_helpdesk.done_stage').id),
# ('priority_new','=',False)])
# )
#if unvalued_tickets >= 3:
# return json.dumps({"resp":"Error","message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos"})
ticket_dic = { ticket_dic = {
'partner_id': partner_id.id, 'partner_id': partner_id.id,
'ticket_from_portal': True 'ticket_from_portal': True
......
...@@ -27,15 +27,15 @@ class ResUsers(models.Model): ...@@ -27,15 +27,15 @@ class ResUsers(models.Model):
res = super(ResUsers, self).create(vals) res = super(ResUsers, self).create(vals)
if res.partner_id and not res.partner_id.email: if res.partner_id and not res.partner_id.email:
res.partner_id.sudo().write({ res.partner_id.sudo().write({
'email':res.user_ids[0].login 'email':res.login
}) })
return res return res
def write(self,vals): def write(self,vals):
res = super(ResUsers, self).write(vals) res = super(ResUsers, self).write(vals)
if self.partner_id and not self.partner_id.email: if self.partner_id and not self.partner_id.email or self.partner_id.email != self.login:
self.sudo().write({ self.partner_id.sudo().write({
'email':res.user_ids[0].login 'email':self.login
}) })
return res return res
\ No newline at end of file
...@@ -494,7 +494,7 @@ class TicketDashboardInherit(models.Model): ...@@ -494,7 +494,7 @@ class TicketDashboardInherit(models.Model):
elif tickt.filtered(lambda x: x.color== 3): elif tickt.filtered(lambda x: x.color== 3):
ticket_wrong = 3 ticket_wrong = 3
list_ids = [id_list,ticket_wrong] list_ids = [id_list,ticket_wrong]
data_dict.update({search_stage.name: [list_ids,ticket_wrong]}) data_dict.update({search_stage.name: [list_ids]})
ticket_data_list.append(search_stage.name) ticket_data_list.append(search_stage.name)
......
...@@ -41,7 +41,10 @@ $(document).ready(function(e) { ...@@ -41,7 +41,10 @@ $(document).ready(function(e) {
var ticket_type = $("#tck_type").val(); var ticket_type = $("#tck_type").val();
if(ticket_type == 'soporte'){ if(ticket_type == 'soporte'){
var rqued = required_support(); var rqued = required_support();
/*ajax_unvalued_tickets(rqued);*/ //ajax_unvalued_tickets(rqued);
console.log(unvaluated)
e.preventDefault();
if (rqued['portal_contact_name'] == ""){ if (rqued['portal_contact_name'] == ""){
e.preventDefault(); e.preventDefault();
swal({ swal({
...@@ -67,12 +70,26 @@ $(document).ready(function(e) { ...@@ -67,12 +70,26 @@ $(document).ready(function(e) {
buttons: "Ok", buttons: "Ok",
}); });
}else if (unvaluated['resp'] == "Error"){ }else if (unvaluated['resp'] == "Error"){
var row = $('<div>',{class:'row'})
if (unvaluated['unvalued'].length > 0 ){
var unvaled = unvaluated['unvalued']
for(var i = 0;i <= unvaled.length;i++){
var data = unvaled[i]
if (Boolean(data) == true){
row.append('<a href="'+data.t_id+'">'+data.t_name+'</a>')
}
};
}
e.preventDefault(); e.preventDefault();
swal({ swal({
title:"Error", title:"Error",
text: unvaluated['message'], text: unvaluated['message'],
icon: "error", icon: "error",
buttons: "Ok", buttons: "Ok",
content: ("<div>hola</div>"),
}); });
} }
}else if(ticket_type == 'erp'){ }else if(ticket_type == 'erp'){
...@@ -303,7 +320,6 @@ $(document).ready(function(e) { ...@@ -303,7 +320,6 @@ $(document).ready(function(e) {
}); });
function ajax_unvalued_tickets(info_form_data){ function ajax_unvalued_tickets(info_form_data){
$.ajax({ $.ajax({
url: "/unvaluated/tickets", url: "/unvaluated/tickets",
...@@ -313,19 +329,22 @@ $(document).ready(function(e) { ...@@ -313,19 +329,22 @@ $(document).ready(function(e) {
cache: false, cache: false,
success: function(result) { success: function(result) {
var response = JSON.parse(result); var response = JSON.parse(result);
return_ajax_value(response.resp,response.message); return_ajax_value(response);
}, },
error: function(data){ error: function(data){
var response = JSON.parse(data); var response = JSON.parse(data);
return_ajax_value(response.resp,response.message); return_ajax_value(response);
} }
}); });
} }
function return_ajax_value(resp,message){ function return_ajax_value(response){
unvaluated = { unvaluated = {
'resp': resp, 'resp': response.resp,
'message':message 'message':response.message,
'unvalued':response.unvalued
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<field name="is_erp" invisible="1"/> <field name="is_erp" invisible="1"/>
<field name="is_emergency" invisible="1"/> <field name="is_emergency" invisible="1"/>
<field name="team_members" widget="many2manytags" invisible="1"/> <field name="team_members" widget="many2manytags" invisible="1"/>
<label for="description"/> <label for="description" string="Descripción del problema"/>
<h3><field name="description" placeholder="Descripción"/></h3> <h3><field name="description" placeholder="Descripción"/></h3>
<label for="descripcion_solution"/> <label for="descripcion_solution"/>
<h3><field name="descripcion_solution" placeholder="Descripción"/></h3> <h3><field name="descripcion_solution" placeholder="Descripción"/></h3>
...@@ -114,22 +114,11 @@ ...@@ -114,22 +114,11 @@
</xpath> </xpath>
<!--<xpath expr="//field[@name='sub_category_id']" position="after">
<field name="ticket_reason" attrs="{'invisible':['|','|',('is_support', '=', True),('is_erp','=',False),('is_emergency','=',False)]}"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="user_branch_id"/>
<field name="user_region_id"/>
</xpath>
<xpath expr="//field[@name='sh_user_ids']" position="after">
<field name="team_members" widget="many2manytags" invisible="1"/>
</xpath>
<xpath expr="//field[@name='helpdesk_stage_history_line']" position="attributes"> <xpath expr="//field[@name='helpdesk_stage_history_line']" position="attributes">
<attribute name="readonly">1</attribute> <attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute> <attribute name="force_save">1</attribute>
</xpath> </xpath>
<xpath expr="//field[@name='priority_new']" position="attributes"> <xpath expr="//field[@name='priority_new']" position="attributes">
<attribute name="readonly">1</attribute> <attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute> <attribute name="force_save">1</attribute>
...@@ -137,10 +126,11 @@ ...@@ -137,10 +126,11 @@
<xpath expr="//field[@name='customer_comment']" position="attributes"> <xpath expr="//field[@name='customer_comment']" position="attributes">
<attribute name="readonly">1</attribute> <attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute> <attribute name="force_save">1</attribute>
</xpath>--> </xpath>
<xpath expr="//notebook" position="inside"> <xpath expr="//notebook" position="inside">
<page string="Movimiento de usuarios"> <page string="Movimiento de usuarios">
<field name="user_changes_ids"> <field name="user_changes_ids" force_save="1" readonly="1">
<tree> <tree>
<field name="create_date"/> <field name="create_date"/>
<field name="user_id"/> <field name="user_id"/>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/erp_back.svg'"/> <t t-set="background" t-value="'/helpdesk_morsa/static/src/img/erp_back.svg'"/>
</t> </t>
</t> </t>
<t t-if="request.env.user.is_911_user">
<t t-call="portal.portal_docs_entry"> <t t-call="portal.portal_docs_entry">
<t t-set="title">TI 911</t> <t t-set="title">TI 911</t>
<t t-set="url" t-value="'/my/911'" /> <t t-set="url" t-value="'/my/911'" />
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/emergency.svg'"/> <t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/emergency.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/emergency_back.svg'"/> <t t-set="background" t-value="'/helpdesk_morsa/static/src/img/emergency_back.svg'"/>
</t> </t>
</t>
</div> </div>
</div> </div>
<div class="oe_structure" id="oe_structure_portal_my_ti_2"/> <div class="oe_structure" id="oe_structure_portal_my_ti_2"/>
......
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
<t t-if="soporte.description"> <t t-if="soporte.description">
<div class="row"> <div class="row">
<div class="mb-3 col-12"> <div class="mb-3 col-12">
<strong>Descripción:</strong> <strong>Descripción del problema:</strong>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -238,6 +238,18 @@ ...@@ -238,6 +238,18 @@
</div> </div>
</div> </div>
</t> </t>
<t t-if="soporte.descripcion_solution">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción de solución:</strong>
</div>
</div>
<div class="row">
<div class="mb-3 col-12">
<span t-field="soporte.descripcion_solution" />
</div>
</div>
</t>
<t t-if="soporte.priority_new and soporte.customer_comment"> <t t-if="soporte.priority_new and soporte.customer_comment">
<div class="row"> <div class="row">
<div class="mb-3 col-6"> <div class="mb-3 col-6">
...@@ -499,7 +511,7 @@ ...@@ -499,7 +511,7 @@
<t t-if="asistencia.description"> <t t-if="asistencia.description">
<div class="row"> <div class="row">
<div class="mb-3 col-12"> <div class="mb-3 col-12">
<strong>Descripción:</strong> <strong>Descripción del problema:</strong>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -508,6 +520,18 @@ ...@@ -508,6 +520,18 @@
</div> </div>
</div> </div>
</t> </t>
<t t-if="asistencia.descripcion_solution">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción de la solución:</strong>
</div>
</div>
<div class="row">
<div class="mb-3 col-12">
<span t-field="asistencia.descripcion_solution" />
</div>
</div>
</t>
<t t-if="asistencia.priority_new and asistencia.customer_comment"> <t t-if="asistencia.priority_new and asistencia.customer_comment">
<div class="row"> <div class="row">
<div class="mb-3 col-6"> <div class="mb-3 col-6">
...@@ -797,7 +821,7 @@ ...@@ -797,7 +821,7 @@
<t t-if="ti.description"> <t t-if="ti.description">
<div class="row"> <div class="row">
<div class="mb-3 col-12"> <div class="mb-3 col-12">
<strong>Descripción:</strong> <strong>Descripción del problema:</strong>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -806,6 +830,18 @@ ...@@ -806,6 +830,18 @@
</div> </div>
</div> </div>
</t> </t>
<t t-if="ti.descripcion_solution">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción de la solución:</strong>
</div>
</div>
<div class="row">
<div class="mb-3 col-12">
<span t-field="ti.descripcion_solution" />
</div>
</div>
</t>
<t t-if="ti.priority_new and ti.customer_comment"> <t t-if="ti.priority_new and ti.customer_comment">
<div class="row"> <div class="row">
<div class="mb-3 col-6"> <div class="mb-3 col-6">
......
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