Commit ac0cc866 by Arturo Jasso Origel

se corrigio el error de ticket sin evaluar, en el que te muestra atraves de una…

se corrigio el error de ticket sin evaluar, en el que te muestra atraves de una alerta los ticket que se encuentran sin evaluar, y posterior al evaluarlos se evaluan todos los que están sin evaluar, se corrgio un error de que creaba un adjunto sin información al momento de crear un ticket, se corrigio el z-index delos header ya que chocaba con los menu de arriba, y se agrego una restricción para que no llegue el correo de ticket creado a los usuarios de soporte, pero si quedo habilitado para el resto de los equipos y se cambio la verificación de tamaño por un row y un col-12 para que se mantenga un diseño responsivo
parent be9a87e7
...@@ -18,9 +18,22 @@ _logger = logging.getLogger(__name__) ...@@ -18,9 +18,22 @@ _logger = logging.getLogger(__name__)
class WebsiteTickets(DownloadReport): class WebsiteTickets(DownloadReport):
@http.route('/ticket/feedback/<ticket_id>',type="http",auth="public",website=True)
def helpdesk_ticket_feedback(self, ticket_id,unvalued=False, **kw):
if unvalued:
unvalued = 'all'
return http.request.render(
'sh_all_in_one_helpdesk.helpdesk_ticket_feedback_page',
{'ticket': ticket_id, 'unvalued':unvalued}
)
@http.route('/helpdesk/ticket/feedback/<ticket_id>', type="http", auth="public", website=True, csrf=False) @http.route('/helpdesk/ticket/feedback/<ticket_id>', type="http", auth="public", website=True, csrf=False)
def helpdesk_ticket_feedback_thanks(self, ticket_id, **kw): def helpdesk_ticket_feedback_thanks(self, ticket_id, **kw):
dic = {} dic = {}
if kw.get('problem_solved') == 'True': if kw.get('problem_solved') == 'True':
dic.update({ dic.update({
'problem_solved_on_time':True 'problem_solved_on_time':True
...@@ -57,7 +70,31 @@ class WebsiteTickets(DownloadReport): ...@@ -57,7 +70,31 @@ class WebsiteTickets(DownloadReport):
}) })
ticket = request.env['helpdesk.ticket'].sudo().search( ticket = request.env['helpdesk.ticket'].sudo().search(
[('id', '=', int(ticket_id))], limit=1) [('id', '=', int(ticket_id))], limit=1)
if ticket: _logger.info('ticket')
unvalued = False
if kw.get('portal_unvalued'):
unvalued = kw.get('portal_unvalued')
_logger.info(unvalued)
if ticket and unvalued == 'all':
_logger.info('Entra tickets')
tickets = request.env['helpdesk.ticket'].sudo().search([
('partner_id','=',ticket.partner_id.id),
('stage_id','=',ticket.stage_id.id),
('team_id','=',ticket.team_id.id)
])
_logger.info(tickets)
if tickets:
_logger.info('Entra tickets')
for t in tickets:
t.sudo().write(dic)
else:
_logger.info('Entra ticket')
ticket.sudo().write(dic)
elif ticket and not unvalued:
_logger.info('Entra ticket')
ticket.sudo().write(dic) ticket.sudo().write(dic)
return http.request.render( elif ticket:
'sh_all_in_one_helpdesk.ticket_feedback_thank_you', {}) ticket.sudo().write(dic)
\ No newline at end of file
return http.request.render('sh_all_in_one_helpdesk.ticket_feedback_thank_you', {})
\ No newline at end of file
...@@ -396,21 +396,22 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk): ...@@ -396,21 +396,22 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk):
ticket_dic) ticket_dic)
if 'portal_file' in request.params: if 'portal_file' in request.params:
attached_files = request.httprequest.files.getlist( if kw.get('portal_file'):
'portal_file') attached_files = request.httprequest.files.getlist('portal_file')
attachment_ids = [] attachment_ids = []
for attachment in attached_files: for attachment in attached_files:
result = base64.b64encode(attachment.read()) result = base64.b64encode(attachment.read())
attachment_id = request.env['ir.attachment'].sudo( if result:
).create({ attachment_id = request.env['ir.attachment'].sudo(
'name': attachment.filename, ).create({
'res_model': 'helpdesk.ticket', 'name': attachment.filename,
'res_id': ticket_id.id, 'res_model': 'helpdesk.ticket',
'display_name': attachment.filename, 'res_id': ticket_id.id,
'datas': result, 'display_name': attachment.filename,
}) 'datas': result,
attachment_ids.append(attachment_id.id) })
ticket_id.attachment_ids = [(6, 0, attachment_ids)] attachment_ids.append(attachment_id.id)
ticket_id.attachment_ids = [(6, 0, attachment_ids)]
return request.redirect("/my/911?ctr=False") return request.redirect("/my/911?ctr=False")
except Exception as e: except Exception as e:
_logger.exception('Something went wrong %s',str(e)) _logger.exception('Something went wrong %s',str(e))
......
...@@ -455,37 +455,42 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -455,37 +455,42 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
ticket_id = request.env['helpdesk.ticket'].sudo().create( ticket_id = request.env['helpdesk.ticket'].sudo().create(
ticket_dic) ticket_dic)
if 'portal_file' in request.params : if 'portal_file' in request.params:
attached_files = request.httprequest.files.getlist('portal_file') if kw.get('portal_file'):
attachment_ids = [] attached_files = request.httprequest.files.getlist('portal_file')
for attachment in attached_files: attachment_ids = []
result = base64.b64encode(attachment.read()) for attachment in attached_files:
attachment_id = request.env['ir.attachment'].sudo( result = base64.b64encode(attachment.read())
).create({ if result:
'name': attachment.filename, attachment_id = request.env['ir.attachment'].sudo(
'res_model': 'helpdesk.ticket', ).create({
'res_id': ticket_id.id, 'name': attachment.filename,
'display_name': attachment.filename, 'res_model': 'helpdesk.ticket',
'datas': result, 'res_id': ticket_id.id,
}) 'display_name': attachment.filename,
attachment_ids.append(attachment_id.id) 'datas': result,
ticket_id.attachment_ids = [(6, 0, attachment_ids)] })
attachment_ids.append(attachment_id.id)
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') if kw.get('portal_file_mejora'):
attachment_ids = [] attached_files = request.httprequest.files.getlist('portal_file_mejora')
for attachment in attached_files: attachment_ids = []
result = base64.b64encode(attachment.read()) for attachment in attached_files:
attachment_id = request.env['ir.attachment'].sudo( result = base64.b64encode(attachment.read())
).create({ if result:
'name': attachment.filename, attachment_id = request.env['ir.attachment'].sudo(
'res_model': 'helpdesk.ticket', ).create({
'res_id': ticket_id.id, 'name': attachment.filename,
'display_name': attachment.filename, 'res_model': 'helpdesk.ticket',
'datas': result, 'res_id': ticket_id.id,
}) 'display_name': attachment.filename,
attachment_ids.append(attachment_id.id) 'datas': result,
ticket_id.attachment_ids = [(6, 0, attachment_ids)] })
attachment_ids.append(attachment_id.id)
ticket_id.attachment_ids = [(6, 0, attachment_ids)]
return request.redirect("/my/erp?ctr=False") return request.redirect("/my/erp?ctr=False")
except Exception as e: except Exception as e:
_logger.exception('Something went wrong %s',str(e)) _logger.exception('Something went wrong %s',str(e))
......
...@@ -396,25 +396,23 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk): ...@@ -396,25 +396,23 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
ticket_dic) ticket_dic)
if 'portal_file' in request.params: if 'portal_file' in request.params:
attached_files = request.httprequest.files.getlist('portal_file') if kw.get('portal_file'):
_logger.info(attached_files) attached_files = request.httprequest.files.getlist('portal_file')
attachment_ids = []
for attachment in attached_files: attachment_ids = []
_logger.info(attachment) for attachment in attached_files:
result = base64.b64encode(attachment.read()) result = base64.b64encode(attachment.read())
if result:
attachment_id = request.env['ir.attachment'].sudo( attachment_id = request.env['ir.attachment'].sudo(
).create({ ).create({
'name': attachment.filename, 'name': attachment.filename,
'res_model': 'helpdesk.ticket', 'res_model': 'helpdesk.ticket',
'res_id': ticket_id.id, 'res_id': ticket_id.id,
'display_name': attachment.filename, 'display_name': attachment.filename,
'datas': result, 'datas': result,
}) })
_logger.info(attachment_id) attachment_ids.append(attachment_id.id)
attachment_ids.append(attachment_id.id) ticket_id.attachment_ids = [(6, 0, attachment_ids)]
_logger.info(attachment_ids)
ticket_id.attachment_ids = [(6, 0, attachment_ids)]
return request.redirect("/my/soporte?ctr=False") return request.redirect("/my/soporte?ctr=False")
......
...@@ -185,47 +185,56 @@ class HelpdeskTicket(models.Model): ...@@ -185,47 +185,56 @@ class HelpdeskTicket(models.Model):
if res.sh_sla_status_ids: if res.sh_sla_status_ids:
for line in res.sh_sla_status_ids: for line in res.sh_sla_status_ids:
line.sh_status = res.sh_status line.sh_status = res.sh_status
if res.ticket_from_website and res.company_id.new_stage_id.mail_template_ids and res.partner_id: if res.ticket_from_website and res.company_id.new_stage_id.mail_template_ids and res.partner_id:
for template in res.company_id.new_stage_id.mail_template_ids: for template in res.company_id.new_stage_id.mail_template_ids:
template.sudo().send_mail(res.id, force_send=True) template.sudo().send_mail(res.id, force_send=True)
else: else:
if not res.ticket_from_website and res.company_id.new_stage_id.mail_template_ids and res.partner_id: if not res.ticket_from_website and res.company_id.new_stage_id.mail_template_ids and res.partner_id:
for template in res.company_id.new_stage_id.mail_template_ids: for template in res.company_id.new_stage_id.mail_template_ids:
template.sudo().send_mail(res.id, force_send=True) template.sudo().send_mail(res.id, force_send=True)
if res.team_id and res.team_head and not res.user_id:
if res.team_id and res.team_head and not res.user_id and vals['team_id'] != self.env.ref('helpdesk_morsa.techinnical_support').id:
allocation_template = res.company_id.allocation_mail_template_id allocation_template = res.company_id.allocation_mail_template_id
email_formatted = [] email_formatted = []
if res.team_head.partner_id.email_formatted not in email_formatted: if res.team_head.partner_id.email_formatted not in email_formatted:
email_formatted.append( email_formatted.append(
res.team_head.partner_id.email_formatted) res.team_head.partner_id.email_formatted)
email_formatted_str = ','.join(email_formatted) email_formatted_str = ','.join(email_formatted)
email_values = { email_values = {
'email_from': str(res.team_head.partner_id.email_formatted), 'email_from': str(res.team_head.partner_id.email_formatted),
'email_to': email_formatted_str 'email_to': email_formatted_str
} }
if allocation_template: if allocation_template:
allocation_template.sudo().send_mail(res.id, allocation_template.sudo().send_mail(res.id,force_send=True,email_values=email_values)
force_send=True,
email_values=email_values)
res.ticket_allocated = True res.ticket_allocated = True
elif res.team_id and res.team_head and res.user_id: elif res.team_id and res.team_head and res.user_id:
allocation_template = res.company_id.allocation_mail_template_id allocation_template = res.company_id.allocation_mail_template_id
email_formatted = [] email_formatted = []
if res.team_head.partner_id.email_formatted not in email_formatted: if res.team_head.partner_id.email_formatted not in email_formatted:
email_formatted.append( email_formatted.append(
res.team_head.partner_id.email_formatted) res.team_head.partner_id.email_formatted)
if res.user_id.partner_id.email_formatted not in email_formatted: if res.user_id.partner_id.email_formatted not in email_formatted:
email_formatted.append(res.user_id.partner_id.email_formatted) email_formatted.append(res.user_id.partner_id.email_formatted)
email_formatted_str = ','.join(email_formatted) email_formatted_str = ','.join(email_formatted)
email_values = { email_values = {
'email_from': str(res.team_head.partner_id.email_formatted), 'email_from': str(res.team_head.partner_id.email_formatted),
'email_to': email_formatted_str 'email_to': email_formatted_str
} }
if allocation_template: if allocation_template:
allocation_template.sudo().send_mail(res.id, allocation_template.sudo().send_mail(res.id,force_send=True,email_values=email_values)
force_send=True,
email_values=email_values)
res.ticket_allocated = True res.ticket_allocated = True
elif res.team_id and res.team_head and not res.user_id and res.sh_user_ids: elif res.team_id and res.team_head and not res.user_id and res.sh_user_ids:
allocation_template = res.company_id.allocation_mail_template_id allocation_template = res.company_id.allocation_mail_template_id
email_formatted = [] email_formatted = []
...@@ -238,18 +247,24 @@ class HelpdeskTicket(models.Model): ...@@ -238,18 +247,24 @@ class HelpdeskTicket(models.Model):
'email_to': email_formatted_str 'email_to': email_formatted_str
} }
if allocation_template: if allocation_template:
allocation_template.sudo().send_mail(res.id, allocation_template.sudo().send_mail(res.id,force_send=True,email_values=email_values)
force_send=True,
email_values=email_values)
res.ticket_allocated = True res.ticket_allocated = True
elif not res.team_id and not res.team_head and res.user_id and res.sh_user_ids: elif not res.team_id and not res.team_head and res.user_id and res.sh_user_ids:
_logger.info('Entra15')
allocation_template = res.company_id.allocation_mail_template_id allocation_template = res.company_id.allocation_mail_template_id
email_formatted = [] email_formatted = []
if res.user_id.partner_id.email_formatted not in email_formatted: if res.user_id.partner_id.email_formatted not in email_formatted:
_logger.info('Entra17')
email_formatted.append(res.user_id.partner_id.email_formatted) email_formatted.append(res.user_id.partner_id.email_formatted)
for user in res.sh_user_ids: for user in res.sh_user_ids:
if user.id != res.user_id.id: if user.id != res.user_id.id:
_logger.info('Entra18')
if user.partner_id.email_formatted not in email_formatted: if user.partner_id.email_formatted not in email_formatted:
_logger.info('Entra19')
email_formatted.append(user.partner_id.email_formatted) email_formatted.append(user.partner_id.email_formatted)
email_formatted_str = ','.join(email_formatted) email_formatted_str = ','.join(email_formatted)
email_values = { email_values = {
...@@ -276,9 +291,7 @@ class HelpdeskTicket(models.Model): ...@@ -276,9 +291,7 @@ class HelpdeskTicket(models.Model):
'email_to': str(res.user_id.partner_id.email_formatted) 'email_to': str(res.user_id.partner_id.email_formatted)
} }
if allocation_template: if allocation_template:
allocation_template.sudo().send_mail(res.id, allocation_template.sudo().send_mail(res.id,force_send=True,email_values=email_values)
force_send=True,
email_values=email_values)
res.ticket_allocated = True res.ticket_allocated = True
elif not res.team_id and not res.team_head and not res.user_id and res.sh_user_ids: elif not res.team_id and not res.team_head and not res.user_id and res.sh_user_ids:
allocation_template = res.company_id.allocation_mail_template_id allocation_template = res.company_id.allocation_mail_template_id
...@@ -292,9 +305,7 @@ class HelpdeskTicket(models.Model): ...@@ -292,9 +305,7 @@ class HelpdeskTicket(models.Model):
'email_to': email_formatted_str 'email_to': email_formatted_str
} }
if allocation_template: if allocation_template:
allocation_template.sudo().send_mail(res.id, allocation_template.sudo().send_mail(res.id,force_send=True,email_values=email_values)
force_send=True,
email_values=email_values)
res.ticket_allocated = True res.ticket_allocated = True
if self.env.company.sh_auto_add_customer_as_follower: if self.env.company.sh_auto_add_customer_as_follower:
res.message_subscribe(partner_ids=res.partner_id.ids) res.message_subscribe(partner_ids=res.partner_id.ids)
......
...@@ -238,7 +238,7 @@ class TicketDashboardInherit(models.Model): ...@@ -238,7 +238,7 @@ class TicketDashboardInherit(models.Model):
if search_tickets: if search_tickets:
id_list = search_tickets.ids id_list = search_tickets.ids
all_dict = {'TODOS': id_list} all_dict = {'Todos': id_list}
return all_dict return all_dict
...@@ -257,8 +257,8 @@ class TicketDashboardInherit(models.Model): ...@@ -257,8 +257,8 @@ class TicketDashboardInherit(models.Model):
id_list = [] id_list = []
for stage in company_id.dashboard_filter: for stage in company_id.dashboard_filter:
doman = [] doman = []
id_list = [] id_list = []
doman.append(('stage_id', '=', stage.id)) doman.append(('stage_id', '=', stage.id))
...@@ -273,6 +273,8 @@ class TicketDashboardInherit(models.Model): ...@@ -273,6 +273,8 @@ class TicketDashboardInherit(models.Model):
datetime.now().date().strftime("%Y/%m/%d 00:00:00")) datetime.now().date().strftime("%Y/%m/%d 00:00:00"))
doman.append(tuple(dt_flt1)) doman.append(tuple(dt_flt1))
dt_flt2 = [] dt_flt2 = []
dt_flt2.append('create_date') dt_flt2.append('create_date')
dt_flt2.append('<=') dt_flt2.append('<=')
...@@ -280,6 +282,7 @@ class TicketDashboardInherit(models.Model): ...@@ -280,6 +282,7 @@ class TicketDashboardInherit(models.Model):
datetime.now().date().strftime("%Y/%m/%d 23:59:59")) datetime.now().date().strftime("%Y/%m/%d 23:59:59"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'yesterday': elif filter_date == 'yesterday':
dt_flt1 = [] dt_flt1 = []
...@@ -297,6 +300,8 @@ class TicketDashboardInherit(models.Model): ...@@ -297,6 +300,8 @@ class TicketDashboardInherit(models.Model):
relativedelta(days=1)).strftime('%Y/%m/%d 23:59:59') relativedelta(days=1)).strftime('%Y/%m/%d 23:59:59')
dt_flt2.append(prev_day) dt_flt2.append(prev_day)
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'weekly': # current week elif filter_date == 'weekly': # current week
...@@ -314,6 +319,8 @@ class TicketDashboardInherit(models.Model): ...@@ -314,6 +319,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append( dt_flt2.append(
datetime.now().date().strftime("%Y/%m/%d 23:59:59")) datetime.now().date().strftime("%Y/%m/%d 23:59:59"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'prev_week': # Previous week elif filter_date == 'prev_week': # Previous week
...@@ -330,6 +337,8 @@ class TicketDashboardInherit(models.Model): ...@@ -330,6 +337,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append((datetime.now().date( dt_flt2.append((datetime.now().date(
) - relativedelta(weeks=1, weekday=6)).strftime("%Y/%m/%d 23:59:59")) ) - relativedelta(weeks=1, weekday=6)).strftime("%Y/%m/%d 23:59:59"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'monthly': # Current Month elif filter_date == 'monthly': # Current Month
...@@ -346,6 +355,8 @@ class TicketDashboardInherit(models.Model): ...@@ -346,6 +355,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append( dt_flt2.append(
datetime.now().date().strftime("%Y/%m/%d 23:59:59")) datetime.now().date().strftime("%Y/%m/%d 23:59:59"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'prev_month': # Previous Month elif filter_date == 'prev_month': # Previous Month
...@@ -362,6 +373,8 @@ class TicketDashboardInherit(models.Model): ...@@ -362,6 +373,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append( dt_flt2.append(
datetime.now().date().strftime("%Y/%m/01 00:00:00")) datetime.now().date().strftime("%Y/%m/01 00:00:00"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'cur_year': # Current Year elif filter_date == 'cur_year': # Current Year
...@@ -378,6 +391,8 @@ class TicketDashboardInherit(models.Model): ...@@ -378,6 +391,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append( dt_flt2.append(
datetime.now().date().strftime("%Y/%m/%d 23:59:59")) datetime.now().date().strftime("%Y/%m/%d 23:59:59"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'prev_year': # Previous Year elif filter_date == 'prev_year': # Previous Year
...@@ -394,6 +409,8 @@ class TicketDashboardInherit(models.Model): ...@@ -394,6 +409,8 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append( dt_flt2.append(
datetime.now().date().strftime("%Y/01/01 00:00:00")) datetime.now().date().strftime("%Y/01/01 00:00:00"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
elif filter_date == 'custom': elif filter_date == 'custom':
if start_date and end_date: if start_date and end_date:
...@@ -410,16 +427,20 @@ class TicketDashboardInherit(models.Model): ...@@ -410,16 +427,20 @@ class TicketDashboardInherit(models.Model):
dt_flt2.append(datetime.strptime( dt_flt2.append(datetime.strptime(
str(end_date), DEFAULT_SERVER_DATE_FORMAT).strftime("%Y/%m/%d")) str(end_date), DEFAULT_SERVER_DATE_FORMAT).strftime("%Y/%m/%d"))
doman.append(tuple(dt_flt2)) doman.append(tuple(dt_flt2))
if team and team not in [None,False,""] and int(team) != 0: if team and team not in [None,False,""] and int(team) != 0:
doman.append(('team_id', '=', int(team))) doman.append(('team_id', '=', int(team)))
if team_leader and team_leader not in [None,False,""] and int(team_leader) != 0: if team_leader and team_leader not in [None,False,""] and int(team_leader) != 0:
doman.append(('team_head', '=', int(team_leader))) doman.append(('team_head', '=', int(team_leader)))
if assign_user and assign_user not in [None,False,""] and int(assign_user) != 0: if assign_user and assign_user not in [None,False,""] and int(assign_user) != 0:
doman.append(('|')) doman.append(('|'))
...@@ -427,6 +448,9 @@ class TicketDashboardInherit(models.Model): ...@@ -427,6 +448,9 @@ class TicketDashboardInherit(models.Model):
doman.append(('user_id', '=', int(assign_user))) doman.append(('user_id', '=', int(assign_user)))
doman.append(('sh_user_ids', 'in', [int(assign_user)])) doman.append(('sh_user_ids', 'in', [int(assign_user)]))
doman.append(('team_id.team_members','in',[self.env.user.id])) doman.append(('team_id.team_members','in',[self.env.user.id]))
elif assign_user and assign_user not in [None,False,""] and int(assign_user) == 0: elif assign_user and assign_user not in [None,False,""] and int(assign_user) == 0:
...@@ -480,6 +504,7 @@ class TicketDashboardInherit(models.Model): ...@@ -480,6 +504,7 @@ class TicketDashboardInherit(models.Model):
} }
ticket_list.append(ticket_dic) ticket_list.append(ticket_dic)
id_list.append(ticket.id) id_list.append(ticket.id)
search_stage = self.env['helpdesk.stages'].sudo().search([ search_stage = self.env['helpdesk.stages'].sudo().search([
('id', '=', stage.id) ('id', '=', stage.id)
], limit=1) ], limit=1)
......
...@@ -41,7 +41,7 @@ $(document).ready(function(e) { ...@@ -41,7 +41,7 @@ $(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);
if (rqued['portal_contact_name'] == ""){ if (rqued['portal_contact_name'] == ""){
e.preventDefault(); e.preventDefault();
swal({ swal({
...@@ -67,28 +67,34 @@ $(document).ready(function(e) { ...@@ -67,28 +67,34 @@ $(document).ready(function(e) {
buttons: "Ok", buttons: "Ok",
}); });
}else if (unvaluated['resp'] == "Error"){ }else if (unvaluated['resp'] == "Error"){
e.preventDefault();
var row = $('<div>',{class:'row'}) const links = document.createElement("div")
if (unvaluated['unvalued'].length > 0 ){ if (unvaluated['unvalued'].length > 0 ){
var unvaled = unvaluated['unvalued'] var unvaled = unvaluated['unvalued']
for(var i = 0;i <= unvaled.length;i++){ for(var i = 0;i <= unvaled.length;i++){
var data = unvaled[i] var data = unvaled[i]
if (Boolean(data) == true){ if (Boolean(data) == true){
row.append('<a href="'+data.t_id+'">'+data.t_name+'</a>') const link = document.createElement('a')
link.href = "/ticket/feedback/"+data['t_id']+'?unvalued=True'
link.text = data['t_name']
links.appendChild(link)
const salto = document.createElement('br')
links.appendChild(salto)
} }
}; };
} }
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>"), content: links,
}); });
} }
}else if(ticket_type == 'erp'){ }else if(ticket_type == 'erp'){
var erp_type = $('#portal_erp_type').val() var erp_type = $('#portal_erp_type').val()
if (erp_type == ""){ if (erp_type == ""){
...@@ -313,7 +319,6 @@ $(document).ready(function(e) { ...@@ -313,7 +319,6 @@ $(document).ready(function(e) {
} }
} }
}); });
......
...@@ -26,5 +26,5 @@ ...@@ -26,5 +26,5 @@
top: 190px; top: 190px;
left: 1; left: 1;
width: 100%; width: 100%;
z-index: 1000; z-index: 100;
} }
\ No newline at end of file
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<field name="team_id" invisible="1"/> <field name="team_id" invisible="1"/>
<field name="team_head" invisible="1"/> <field name="team_head" invisible="1"/>
<field name="team_admin_id" invisible="1"/> <field name="team_admin_id" invisible="1"/>
<field name="user_id"/>
<field name="category_id"/> <field name="category_id"/>
<field name="priority"/> <field name="priority"/>
<field name="ticket_reason"/> <field name="ticket_reason"/>
...@@ -130,15 +131,37 @@ ...@@ -130,15 +131,37 @@
<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" force_save="1" readonly="1"> <div class="row">
<tree> <div class="col-12">
<field name="create_date"/> <field name="user_changes_ids" force_save="1" readonly="1">
<field name="user_id"/> <tree>
<field name="user_second_id"/> <field name="create_date" string="Fecha de creación"/>
</tree> <field name="user_id"/>
</field> <field name="user_second_id"/>
</tree>
</field>
</div>
</div>
</page> </page>
</xpath> </xpath>
<xpath expr="//page[2]//group" position="replace">
<div class="row">
<div class="col-12">
<field name="attachment_ids" context="{'default_res_model': 'helpdesk.ticket','default_res_id':active_id}">
<tree>
<field name="name"/>
<field name="type"/>
<field name="original_id"/>
<field name="datas"/>
</tree>
</field>
</div>
</div>
</xpath>
</field> </field>
</record> </record>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<template id="template_id" name="feedback inherit" inherit_id="sh_all_in_one_helpdesk.helpdesk_ticket_feedback_page"> <template id="template_id" name="feedback inherit" inherit_id="sh_all_in_one_helpdesk.helpdesk_ticket_feedback_page">
<xpath expr="//form[@id='smileys']" position="replace"> <xpath expr="//form[@id='smileys']" position="replace">
<form method="POST" t-attf-action="/helpdesk/ticket/feedback/#{ticket}" id="smileys"> <form method="POST" t-attf-action="/helpdesk/ticket/feedback/#{ticket}" id="smileys">
<input type="hidden" name="portal_unvalued" id="portal_unvalued" t-att-value="unvalued"/>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h5>¿Solucionamos completamente tu problema?</h5> <h5>¿Solucionamos completamente tu problema?</h5>
......
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