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,28 +49,37 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
@http.route(['/unvaluated/tickets'],type='http',auth="none",website=True,csrf=False)
def verify_unvaluated_tikets(self,**kw):
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:
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)
unvalued_tickets = len(
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 unvalued_tickets >= 3:
if partner_id:
return json.dumps({"resp":"Error","message":"Tienes demasiados tickets sin evaluar, favor de evaluarlos"})
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)])
_logger.info(unvalued_tickets)
if len(unvalued_tickets) >= 3:
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":"Success","message":""})
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):
partner_id = request.env.user.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:
#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 = {
'partner_id': partner_id.id,
'ticket_from_portal': True
......
......@@ -375,15 +375,9 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
partner_id = request.env.user.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:
#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 = {
'partner_id': partner_id.id,
'ticket_from_portal': True
......@@ -429,7 +423,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
'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'):
ticket_dic.update({
'module_route': kw.get('portal_route')
......@@ -457,13 +451,6 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
ticket_dic.update({
'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_dic)
......@@ -483,6 +470,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
})
attachment_ids.append(attachment_id.id)
ticket_id.attachment_ids = [(6, 0, attachment_ids)]
if 'portal_file_mejora' in request.params :
attached_files = request.httprequest.files.getlist('portal_file_mejora')
attachment_ids = []
......
......@@ -358,15 +358,9 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
partner_id = request.env.user.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:
#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 = {
'partner_id': partner_id.id,
'ticket_from_portal': True
......
......@@ -27,15 +27,15 @@ class ResUsers(models.Model):
res = super(ResUsers, self).create(vals)
if res.partner_id and not res.partner_id.email:
res.partner_id.sudo().write({
'email':res.user_ids[0].login
'email':res.login
})
return res
def write(self,vals):
res = super(ResUsers, self).write(vals)
if self.partner_id and not self.partner_id.email:
self.sudo().write({
'email':res.user_ids[0].login
if self.partner_id and not self.partner_id.email or self.partner_id.email != self.login:
self.partner_id.sudo().write({
'email':self.login
})
return res
\ No newline at end of file
......@@ -494,7 +494,7 @@ class TicketDashboardInherit(models.Model):
elif tickt.filtered(lambda x: x.color== 3):
ticket_wrong = 3
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)
......
......@@ -41,7 +41,10 @@ $(document).ready(function(e) {
var ticket_type = $("#tck_type").val();
if(ticket_type == 'soporte'){
var rqued = required_support();
/*ajax_unvalued_tickets(rqued);*/
//ajax_unvalued_tickets(rqued);
console.log(unvaluated)
e.preventDefault();
if (rqued['portal_contact_name'] == ""){
e.preventDefault();
swal({
......@@ -67,12 +70,26 @@ $(document).ready(function(e) {
buttons: "Ok",
});
}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();
swal({
title:"Error",
text: unvaluated['message'],
icon: "error",
buttons: "Ok",
content: ("<div>hola</div>"),
});
}
}else if(ticket_type == 'erp'){
......@@ -299,10 +316,9 @@ $(document).ready(function(e) {
}
}
});
function ajax_unvalued_tickets(info_form_data){
$.ajax({
......@@ -313,19 +329,22 @@ $(document).ready(function(e) {
cache: false,
success: function(result) {
var response = JSON.parse(result);
return_ajax_value(response.resp,response.message);
return_ajax_value(response);
},
error: function(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 = {
'resp': resp,
'message':message
'resp': response.resp,
'message':response.message,
'unvalued':response.unvalued
}
}
......
......@@ -47,7 +47,7 @@
<field name="is_erp" invisible="1"/>
<field name="is_emergency" 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>
<label for="descripcion_solution"/>
<h3><field name="descripcion_solution" placeholder="Descripción"/></h3>
......@@ -114,22 +114,11 @@
</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">
<attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute>
</xpath>
<xpath expr="//field[@name='priority_new']" position="attributes">
<attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute>
......@@ -137,10 +126,11 @@
<xpath expr="//field[@name='customer_comment']" position="attributes">
<attribute name="readonly">1</attribute>
<attribute name="force_save">1</attribute>
</xpath>-->
</xpath>
<xpath expr="//notebook" position="inside">
<page string="Movimiento de usuarios">
<field name="user_changes_ids">
<field name="user_changes_ids" force_save="1" readonly="1">
<tree>
<field name="create_date"/>
<field name="user_id"/>
......
......@@ -25,16 +25,16 @@
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/erp_back.svg'"/>
</t>
</t>
<t t-if="request.env.user.is_911_user">
<t t-call="portal.portal_docs_entry">
<t t-set="title">TI 911</t>
<t t-set="url" t-value="'/my/911'" />
<t t-set="count" t-value="ti_count" />
<t t-set="desc" t-value="'Emergerncias'"/>
<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 t-call="portal.portal_docs_entry">
<t t-set="title">TI 911</t>
<t t-set="url" t-value="'/my/911'" />
<t t-set="count" t-value="ti_count" />
<t t-set="desc" t-value="'Emergerncias'"/>
<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>
</div>
</div>
<div class="oe_structure" id="oe_structure_portal_my_ti_2"/>
......
......@@ -229,7 +229,7 @@
<t t-if="soporte.description">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción:</strong>
<strong>Descripción del problema:</strong>
</div>
</div>
<div class="row">
......@@ -238,6 +238,18 @@
</div>
</div>
</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">
<div class="row">
<div class="mb-3 col-6">
......@@ -499,7 +511,7 @@
<t t-if="asistencia.description">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción:</strong>
<strong>Descripción del problema:</strong>
</div>
</div>
<div class="row">
......@@ -508,6 +520,18 @@
</div>
</div>
</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">
<div class="row">
<div class="mb-3 col-6">
......@@ -797,7 +821,7 @@
<t t-if="ti.description">
<div class="row">
<div class="mb-3 col-12">
<strong>Descripción:</strong>
<strong>Descripción del problema:</strong>
</div>
</div>
<div class="row">
......@@ -806,6 +830,18 @@
</div>
</div>
</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">
<div class="row">
<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