Commit 71c7850e by Arturo Jasso Origel

cambios

parent 78c5ca8f
......@@ -9,14 +9,18 @@
"summary":"Actualizaciones de campos y vistas",
"description":"""Actualización para requerimientos de morsa """,
"version":"15.0.34",
"depends": ["base","sh_all_in_one_helpdesk"],
"depends": [
"base",
"sh_all_in_one_helpdesk",
"vista_backend_theme",
],
"data": [
'data/helpdesk_team.xml',
'data/helpdesk_stage.xml',
'data/sla_policies.xml',
'data/modules.xml',
'data/warehouses.xml',
'data/rejected_reason.xml',
'data/ticket_reason.xml',
'security/ir.model.access.csv',
'views/portal/portal_layout.xml',
'views/portal/portal_my.xml',
......@@ -25,13 +29,13 @@
'views/portal/portal_tickets_support.xml',
'views/portal/portal_page.xml',
'views/portal/portal_feedback.xml',
'views/odoo/helpdesk_settings.xml',
'views/odoo/helpdesk_ticket.xml',
'views/odoo/helpdesk_team.xml',
'views/odoo/helpdesk_warehouse.xml',
'views/odoo/helpdesk_module.xml',
'views/odoo/helpdesk_reason.xml',
'views/odoo/res_users.xml',
],
'assets': {
'web.assets_qweb': [
......
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<record id="reason_support" model="rejected.reason">
<record id="reason_support" model="ticket.reason">
<field name="name">Soporte</field>
</record>
<record id="reason_user_kwnolegde" model="rejected.reason">
<record id="reason_user_kwnolegde" model="ticket.reason">
<field name="name">Desconocimiento de usuario</field>
</record>
<record id="reason_fail" model="rejected.reason">
<record id="reason_fail" model="ticket.reason">
<field name="name">Falla</field>
</record>
<record id="reason_anything" model="rejected.reason">
<record id="reason_anything" model="ticket.reason">
<field name="name">Ninguno</field>
</record>
......
from . import rejected_reason
from . import ticket_reason
from . import warehouse_helpdesk
from . import erp_module
from . import res_users
from . import helpdesk_team
from . import helpdesk_ticket
from . import helpdesk_settings
from . import helpdesk_sla
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class HelpdeskSettings(models.TransientModel):
_inherit = 'res.config.settings'
description_min_lenght = fields.Integer('Tamaño mínimo de Descripcion')
time_simple_alert = fields.Float('Tiempo de atención simple')
time_medium_alert = fields.Float('Tiempo de atención media')
time_extreme_alert = fields.Float('Tiempo de atención máxima')
color_simple_alert = fields.Integer("Color para atención simple",default=3)
color_medium_alert = fields.Integer("Color para atención media",default=2)
color_extreme_alert = fields.Integer("Color para atención máxima",default=9)
def set_values(self):
super(HelpdeskSettings, self).set_values()
self.env['ir.config_parameter'].set_param('helpdesk_morsa.description_min_lenght', self.description_min_lenght)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.time_simple_alert', self.time_simple_alert)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.time_medium_alert', self.time_medium_alert)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.time_extreme_alert', self.time_extreme_alert)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.color_simple_alert', self.color_simple_alert)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.color_medium_alert', self.color_medium_alert)
self.env['ir.config_parameter'].set_param('helpdesk_morsa.color_extreme_alert', self.color_extreme_alert)
@api.model
def get_values(self):
res = super(HelpdeskSettings, self).get_values()
params = self.env['ir.config_parameter'].sudo()
res.update(description_min_lenght=params.get_param('helpdesk_morsa.description_min_lenght'))
res.update(time_simple_alert=params.get_param('helpdesk_morsa.time_simple_alert'))
res.update(time_medium_alert=params.get_param('helpdesk_morsa.time_medium_alert'))
res.update(time_extreme_alert=params.get_param('helpdesk_morsa.time_extreme_alert'))
res.update(color_simple_alert=params.get_param('helpdesk_morsa.color_simple_alert'))
res.update(color_medium_alert=params.get_param('helpdesk_morsa.color_medium_alert'))
res.update(color_extreme_alert=params.get_param('helpdesk_morsa.color_extreme_alert'))
return res
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class HelpdeskSla(models.Model):
_inherit = 'sh.helpdesk.sla'
@api.model
def create(self,vals):
res = super(HelpdeskSla, self).create(vals)
if res.sh_team_id:
res.update({'sh_ticket_type_id': res.sh_team_id.helpdesk_ticket_type_id.id})
return res
\ No newline at end of file
......@@ -22,11 +22,11 @@ class HelpdeskTicket(models.Model):
],string="Incidencia")
warehouse_id = fields.Many2one('warehouse.helpdesk','Sucursal')
call_before_10 = fields.Boolean('Atención antes de 10 minutos')
color = fields.Integer('Color',compute='_get_color')
color = fields.Integer('Color',compute="_get_color")
erp_type = fields.Selection([
('soporte','Soporte'),('mejora','Mejora')
],string="Tipo de asistencia")
rejected_reason = fields.Many2one('rejected.reason','Razón de rechazo',
ticket_reason = fields.Many2one('ticket.reason','Motivo de Ticket',
default=lambda self: self.env.ref('helpdesk_morsa.reason_anything').id
)
problem_solved_on_time = fields.Boolean('¿Solucionamos complementame tu problema?')
......@@ -37,19 +37,26 @@ class HelpdeskTicket(models.Model):
is_emergency = fields.Boolean('Es 911',compute='_compute_ticket_type')
def _get_color(self):
in_progress_stage = self.env.ref('sh_all_in_one_helpdesk.in_progress_stage').id
new_stage = self.env.ref('sh_all_in_one_helpdesk.new_stage').id
ten_min = self.env.ref('helpdesk_morsa.response_10_minutes').id
simple_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.time_simple_alert'))
medium_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.time_medium_alert'))
extreme_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.time_extreme_alert'))
for rec in self:
if fields.Datetime.now() > rec.create_date+timedelta(hours=6) and fields.Datetime.now() < rec.create_date+timedelta(hours=12) and rec.stage_id.id in [in_progress_stage,new_stage,ten_min]:
rec.color = 3
elif fields.Datetime.now() > rec.create_date+timedelta(hours=12) and rec.stage_id.id in [in_progress_stage,new_stage,ten_min]:
rec.color = 9
if fields.Datetime.now() >= rec.create_date+timedelta(hours=simple_time) and fields.Datetime.now() < rec.create_date+timedelta(hours=medium_time) and rec.stage_id.id in [new_stage]:
rec.color = self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.color_simple_alert')
elif fields.Datetime.now() >= rec.create_date+timedelta(hours=medium_time) and fields.Datetime.now() < rec.create_date+timedelta(hours=extreme_time) and rec.stage_id.id in [new_stage,ten_min]:
rec.color = self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.color_medium_alert')
elif fields.Datetime.now() >= rec.create_date+timedelta(hours=extreme_time) and rec.stage_id.id in [new_stage,ten_min,in_progress_stage]:
rec.color = self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.color_extreme_alert')
else:
rec.color = 10
@api.depends('team_id')
def _compute_ticket_type(self):
for ticket in self:
......@@ -151,7 +158,7 @@ class HelpdeskTicket(models.Model):
team = self.env['helpdesk.team'].sudo().search([('id','=',vals['team_id'])])
if team.helpdesk_ticket_type_id:
vals['ticket_type'] = team.helpdesk_ticket_type_id.id
vals['team_head'] = team.team_head.id
else:
raise ValidationError(('No se pueden generar ticket, no cuenta con la configuración necesaria'))
vals['name'] = self.env['ir.sequence'].sudo().next_by_code('helpdesk.ticket.'+str(team.id) or _('New'))
......@@ -285,27 +292,37 @@ class HelpdeskTicket(models.Model):
res.ticket_allocated = True
if self.env.company.sh_auto_add_customer_as_follower:
res.message_subscribe(partner_ids=res.partner_id.ids)
res.create_initial_history_changes()
return res
@api.onchange("stage_id")
def onchange_stage_id(self):
if self.description == '<p><br></p>' or self.description==False:
raise ValidationError (_("Para cambiar de etapa, es necesario agregar una descripción"))
else:
pass
def create_initial_history_changes(self):
stage_history={
'stage_task_id': self.id,
'stage_name': self.stage_id.name,
'date_in': datetime.now(),
'date_in_by': self.env.user.id,
}
self.env['sh.helpdesk.ticket.stage.info'].sudo().create(stage_history)
def write(self,vals):
if "stage_id" in vals:
if self.description == '<p><br></p>' or self.description==False:
raise ValidationError (_("Para cambiar de etapa, es necesario agregar una descripción"))
else:
return super(HelpdeskTicket, self).write(vals)
else:
if "description" in vals:
min_description = int(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.description_min_lenght'))
if len(vals['description'])-11 < min_description:
raise ValidationError (_("Favor de agregar al menos "+str(min_description)+" caracteres a la descripción"))
return super(HelpdeskTicket, self).write(vals)
def action_approve(self):
if self.description == '<p><br></p>' or self.description==False:
raise ValidationError (_("Para cambiar de etapa, es necesario agregar una descripción"))
......
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class RejectedReason(models.Model):
_name = 'rejected.reason'
class TicketReason(models.Model):
_name = 'ticket.reason'
_rec_name = 'name'
......
......@@ -5,6 +5,6 @@ hlp_erp_modules,erp.modules.admin,model_erp_modules,sh_all_in_one_helpdesk.helpd
user_warehouse_helpdesk,warehouse.helpdesk_user,model_warehouse_helpdesk,base.group_user,1,1,1,0
hlp_warehouse_helpdesk,warehouse.helpdesk.admin,model_warehouse_helpdesk,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_rejected_reason,rejected.reason.user,model_rejected_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,0
hlp_rejected_reason,rejected.reason.admin,model_rejected_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_ticket_reason,ticket.reason.user,model_ticket_reason,base.group_user,,1,1,1,0
hlp_ticket_reason,ticket.reason.admin,model_ticket_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
.oe_kanban_color_9{
color: #fff;
color: #ffffff;
background-color: #dc3545 !important;
border-color: #dc3545 !important;
}
......@@ -9,3 +9,9 @@
background-color: #ffc107 !important;
border-color: #ffc107 !important;
}
.oe_kanban_color_2{
color: #ffffff;
background-color: #ff9409 !important;
border-color: #ff9409 !important;
}
......@@ -5,11 +5,18 @@
}
.small{
font-size: 12px !important;
font-weight: bold !important;
}
.bg-light{
box-shadow: 5px 5px 10px rgba(0,0,0,0.3);
}
.card-body{
.card-body-custom{
box-shadow: 10px 10px 20px rgba(0,0,0,0.2);
}
......
......@@ -2,8 +2,8 @@
<odoo>
<record id="helpdesk_reason_view_tree" model="ir.ui.view">
<field name="name">rejected.reason.tree</field>
<field name="model">rejected.reason</field>
<field name="name">ticket.reason.tree</field>
<field name="model">ticket.reason</field>
<field name="arch" type="xml">
<tree editable="top">
<field name="name"/>
......@@ -14,14 +14,14 @@
<record id="helpdesk_reason_act_window" model="ir.actions.act_window">
<field name="name">Motivo</field>
<field name="res_model">rejected.reason</field>
<field name="res_model">ticket.reason</field>
<field name="view_mode">tree</field>
</record>
<menuitem
name="Motivos de rechazo de ticket"
name="Motivos de ticket"
sequence="14"
id="ticket_rejected"
id="ticket_reason"
parent="sh_all_in_one_helpdesk.helpdesk_config_menu"
action="helpdesk_reason_act_window"/>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="helpdesk_config_settings_inherit">
<field name="name">res.config.settings.inherit</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.helpdesk_config_setting_view"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='ticket_settings']" position="inside">
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="description_min_lenght" />
<br />
<field name="description_min_lenght" class="oe_inline" />
</div>
<div class="o_setting_left_pane"></div>
</div>
</div>
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="time_simple_alert" />
<br />
<field name="time_simple_alert" class="oe_inline" widget="float_time"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="color_simple_alert" />
<br />
<field name="color_simple_alert" class="oe_inline" widget="color_picker"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
</div>
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="time_medium_alert" />
<br />
<field name="time_medium_alert" class="oe_inline" widget="float_time"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="color_medium_alert" />
<br />
<field name="color_medium_alert" class="oe_inline" widget="color_picker"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
</div>
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="time_extreme_alert" />
<br />
<field name="time_extreme_alert" class="oe_inline" widget="float_time"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="color_extreme_alert" />
<br />
<field name="color_extreme_alert" class="oe_inline" widget="color_picker"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -52,8 +52,8 @@
<field name="good_service_actitude"/>
<field name="begin_before_ten_min"/>
</xpath>
<xpath expr="//field[@name='cancel_by']" position="after">
<field name="rejected_reason"/>
<xpath expr="//field[@name='sub_category_id']" position="after">
<field name="ticket_reason"/>
</xpath>
</field>
</record>
......@@ -101,9 +101,13 @@
<field name="team_id" required="1" string="Tipo de ticket"/>
<field name="ticket_type" required="1" invisible="1"/>
<field name="partner_id" required="1"/>
<field name="erp_id" attrs="{'invisible':[('team_id', '!=', 2)],'required':[('team_id', '=', 2)]}"/>
<field name="warehouse_id" attrs="{'invisible':[('team_id', '!=', 2)],'required':[('team_id', '=', 2)]}"/>
<field name="incidence_type" attrs="{'invisible':[('team_id', '!=', 3)],'required':[('team_id', '=', 3)]}"/>
<field name="is_support" invisible="1"/>
<field name="is_erp" invisible="1"/>
<field name="is_emergency" invisible="1"/>
<field name="erp_type" widget="radio" attrs="{'invisible':[('is_erp', '=', False)]}" options="{'horizontal': true}"/>
<field name="erp_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="warehouse_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="incidence_type" attrs="{'invisible':[('is_emergency', '=', False)]}"/>
</group>
</form>
</field>
......
......@@ -67,5 +67,10 @@
</xpath>
</template>
<template id="remove_po_db" name="Remove Power and DB manager" inherit_id="vista_backend_theme.code_custom_login">
<xpath expr="//div[@class='text-center small mt-4 pt-3 border-top']" position="replace">
<div></div>
</xpath>
</template>
</odoo>
\ No newline at end of file
......@@ -22,7 +22,7 @@
<template id="change_portal_layout" name="portal update docs" inherit_id="portal.portal_docs_entry">
<xpath expr="//a" position="replace">
<div class="col-sm-12 col-md-6 col-lg-4 mb-5">
<div class="card-body" style="background-color:white !important;">
<div class="card-body card-body-custom" style="background-color:white !important;">
<header class="card__primary-title">
<figure class="image image--avatar">
<t t-if="avatar">
......
......@@ -7,7 +7,7 @@
<t t-call="portal.portal_searchbar">
<t t-set="title">TI 911</t>
<div class="form-inline ml-lg-4">
<a id="new_request" class="btn btn-success btn-sm" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button"><i class="fa fa-plus" />Crear Ticket</a>
<a id="new_request" class="btn btn-secondary btn-sm" style="color:#FFFFFF" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button"><i class="fa fa-plus" />Crear Ticket</a>
</div>
<input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
</t>
......
......@@ -8,7 +8,7 @@
<t t-call="portal.portal_searchbar">
<t t-set="title">Asistencia ERP</t>
<div class="form-inline ml-lg-4">
<a id="new_request" class="btn btn-success btn-sm" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button"><i class="fa fa-plus" />Crear Ticket</a>
<a id="new_request" class="btn btn-secondary btn-sm" style="color:#FFFFFF" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button" ><i class="fa fa-plus" />Crear Ticket</a>
</div>
<input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
</t>
......
......@@ -8,7 +8,7 @@
<t t-set="title">Soporte Técnico</t>
<div class="form-inline ml-lg-4">
<a id="new_request" class="btn btn-success btn-sm" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button"><i class="fa fa-plus" />Crear Ticket</a>
<a id="new_request" class="btn btn-secondary btn-sm" style="color:#FFFFFF" name="new_request" title="Create Support Request" aria-label="Create Support Request" role="button"><i class="fa fa-plus" />Crear Ticket</a>
</div>
<input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
......
......@@ -23,6 +23,7 @@ class HelpdeskTeamInherit(models.Model):
helpdesk_stage_history_line=fields.One2many("sh.helpdesk.ticket.stage.info",'stage_task_id',string="Stage History Line")
def write(self, vals):
res = super(HelpdeskTeamInherit, self).write(vals)
......
......@@ -7,7 +7,7 @@
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Helpdesk Settings" string="Helpdesk" data-key="sh_all_in_one_helpdesk">
<div>
<div id="ticket_settings">
<h2>Ticket Settings</h2>
<field name="company_id" invisible="1" />
<div class="row o_settings_container">
......
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<menuitem id="base.menu_administration" name="Settings"
web_icon="vista_backend_theme,static/src/img/icons/settinga.png"/>
<menuitem id="base.menu_administration" name="Settings" web_icon="vista_backend_theme,static/src/img/icons/settinga.png"/>
<menuitem id="base.menu_management" name="Apps" web_icon="vista_backend_theme,static/src/img/icons/apps.png"/>
<menuitem id="mail.menu_root_discuss" name="Discuss"
web_icon="vista_backend_theme,static/src/img/icons/discuss.png"/>
<menuitem id="mail.menu_root_discuss" name="Discuss" web_icon="vista_backend_theme,static/src/img/icons/discuss.png"/>
</data>
</odoo>
\ No newline at end of file
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