Commit 0a8a86b5 by Arturo Jasso Origel

se hicieron ajustes y se agregaron nuevos campos

parent acb8bf59
__pycache__
.vscode/
*.pyc
query_deluxe
\ No newline at end of file
......@@ -18,15 +18,19 @@
"helpdesk_morsa",
],
"data": [
'security/ir.model.access.csv',
'data/helpdesk_team.xml',
'data/maintenance_type.xml',
'views/res_config_settings.xml',
'views/portal_my.xml',
'views/portal_maintenance.xml',
'views/portal_emergency.xml',
'views/helpdesk_ticket.xml',
'views/res_users.xml',
],
'assets': {
'web.assets_frontend': [
'https://code.jquery.com/ui/1.12.1/jquery-ui.js',
'/helpdesk_maintenance/static/src/scss/portal.scss',
'/helpdesk_maintenance/static/src/js/portal.js',
],
......
......@@ -6,6 +6,7 @@
<field name="short_name">MAN</field>
<field name="team_head" ref="base.user_admin"/>
<field name="sh_resource_calendar_id" ref="resource.resource_calendar_std"/>
<field name="is_maintenance_team" eval="True"/>
</record>
</data>
......
from . import helpdesk_ticket
from . import maintenance_type
from . import res_users
from . import res_config_settings
from . import helpdesk_team
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class HelpdeskTeamInherit(models.Model):
_inherit = 'helpdesk.team'
is_maintenance_team = fields.Boolean('Equipo de soporte')
\ No newline at end of file
......@@ -40,3 +40,24 @@ class HelpdeskTicket(models.Model):
ticket.is_maintenance = True
else:
ticket.is_maintenance = False
def _get_color(self):
super(HelpdeskTicket, self)._get_color()
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
simple_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_maintenance.time_simple_alert_maintenance'))
medium_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_maintenance.time_medium_alert_maintenance'))
extreme_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_maintenance.time_extreme_alert_maintenance'))
for rec in self:
if rec.is_maintenance:
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_maintenance.color_simple_alert_maintenance')
if 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,in_progress_stage]:
rec.color = self.env['ir.config_parameter'].sudo().get_param('helpdesk_maintenance.color_medium_alert_maintenance')
if fields.Datetime.now() >= rec.create_date+timedelta(hours=extreme_time) and rec.stage_id.id in [new_stage,in_progress_stage]:
rec.color = self.env['ir.config_parameter'].sudo().get_param('helpdesk_maintenance.color_extreme_alert_maintenance')
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class MaintenanceResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
time_simple_alert_maintenance = fields.Float('Tiempo de atención simple')
time_medium_alert_maintenance = fields.Float('Tiempo de atención media')
time_extreme_alert_maintenance = fields.Float('Tiempo de atención máxima')
color_simple_alert_maintenance = fields.Integer("Color para atención simple",default=3)
color_medium_alert_maintenance = fields.Integer("Color para atención media",default=2)
color_extreme_alert_maintenance = fields.Integer("Color para atención máxima",default=9)
def set_values(self):
super(MaintenanceResConfigSettings, self).set_values()
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.time_simple_alert_maintenance', self.time_simple_alert_maintenance)
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.time_medium_alert_maintenance', self.time_medium_alert_maintenance)
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.time_extreme_alert_maintenance', self.time_extreme_alert_maintenance)
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.color_simple_alert_maintenance', self.color_simple_alert_maintenance)
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.color_medium_alert_maintenance', self.color_medium_alert_maintenance)
self.env['ir.config_parameter'].set_param('helpdesk_maintenance.color_extreme_alert_maintenance', self.color_extreme_alert_maintenance)
@api.model
def get_values(self):
res = super(MaintenanceResConfigSettings, self).get_values()
params = self.env['ir.config_parameter'].sudo()
res.update(time_simple_alert_maintenance=params.get_param('helpdesk_maintenance.time_simple_alert_maintenance'))
res.update(time_medium_alert_maintenance=params.get_param('helpdesk_maintenance.time_medium_alert_maintenance'))
res.update(time_extreme_alert_maintenance=params.get_param('helpdesk_maintenance.time_extreme_alert_maintenance'))
res.update(color_simple_alert_maintenance=params.get_param('helpdesk_maintenance.color_simple_alert_maintenance'))
res.update(color_medium_alert_maintenance=params.get_param('helpdesk_maintenance.color_medium_alert_maintenance'))
res.update(color_extreme_alert_maintenance=params.get_param('helpdesk_maintenance.color_extreme_alert_maintenance'))
return res
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError,ValidationError
class ResUsersInherit(models.Model):
_inherit = 'res.users'
is_maintenance = fields.Boolean('Usuario Mantenimiento')
maintenance_position = fields.Selection([
('suc_admin','Administrador de sucursal'),
('gun','GUN'),
('wh_admin','Jefe de Almacén'),
],'Puesto')
@api.model
def create(self,vals):
res = super(ResUsersInherit, self).create(vals)
user = res.no_create_user_maintenance()
if user:
return res
raise ValidationError(_('Ya existe un usuario asignado a esa sucursal con el mismo puesto'))
def write(self,vals):
res = super(ResUsersInherit, self).write(vals)
user = self.no_create_user_maintenance()
if user:
return res
raise ValidationError(_('Ya existe un usuario asignado a esa sucursal con el mismo puesto'))
def no_create_user_maintenance(self):
if self.is_maintenance == True:
users = self.search([('warehouse_id','=',self.warehouse.id),('is_maintenance','=',True),('maintenance_position','=',self.maintenance_position)])
if len(users) == 0:
return True
else:
return False
return True
\ No newline at end of file
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
user_maintenance_type,maintenance.type.user,model_maintenance_type,base.group_user,1,0,0,0
admin_maintenance_type,maintenance.type.admin,model_maintenance_type,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
$(document).ready(function(e) {
$("#portal_date_fail").datepicker();
verify_date();
$("#form_id").submit(function (e){
var ticket_type = $("#tck_type").val();
if (ticket_type == "mantenimiento"){
......@@ -115,37 +118,34 @@ $(document).ready(function(e) {
})
}
$(document).on("change", "#portal_date_fail", function (e) {
let dateformat = /^(0?[1-9]|[1-2][0-9]|3[01])[\/](0?[1-9]|1[0-2])/;
var date = $("#portal_date_fail").val();
if (date.match(dateformat)){
var response = validate_Date(date)
console.log(response)
if (response == ""){
$("#portal_date_fail").val("");
show_error("Favor de ingresar el formato de fecha valido");
}
function verify_date(){
var t_type = $("#tck_type").val();
if (t_type == "mantenimiento"){
console.log("mantenimiento");
var date = new Date();
var day = date.getDay();
if (day == 3){
console.log("Entra day")
hours == date.getHours();
if(hours >= 8 && hours <= 20){
$("#mdl_shw").val("show");
//$("#new_request").addClass("");
}else{
console.log('formato aún no valido')
$("#mdl_shw").val("hide");
$("#new_request").addClass("d-none")
}
});
function validate_Date(date){
let ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
dt = date.split("/");
day = parseInt(dt[0]);
month = parseInt(dt[1]);
year = parseInt(dt[2]);
if (month > 0 && month <= ListofDays.length && Number.isInteger(year)){
if( day > 0 && day <= ListofDays[month-1]){
return date
}else{
return "";
$("#mdl_shw").val("hide");
$("#new_request").addClass("d-none")
}
}
}else{
return "";
}
if($("#mdl_shw").val() == 'show'){
$("#createticketModalMaintenance").modal("show");
}else{
$("#createticketModalMaintenance").modal("hide");
}
});
\ No newline at end of file
......@@ -7,12 +7,11 @@
<t t-call="portal.portal_searchbar">
<t t-set="title">Mantenimiento</t>
</t>
<input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
<div id="createticketModal" class="modal fade" role="dialog">
<div id="createticketModalMaintenance" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" style="max-height:650px;">
<div class="modal-body">
......@@ -72,7 +71,7 @@
<!--fecha de decteción de falla-->
<div t-attf-class="form-group o_website_form_required_custom #{error and 'portal_date_fail' in error and 'has-error' or ''}">
<label class="control-label" for="portal_date_fail">¿Cuando detecto la falla?</label>
<input type="text" class="form-control form-field s_website_form_required" id="portal_date_fail" name="portal_date_fail" placeholder="(dd/mm/yyyy)" required="" />
<input type="text" class="form-control form-field s_website_form_required" id="portal_date_fail" name="portal_date_fail" required="" />
</div>
<!--Tipo de gravedad-->
<div t-attf-class="form-group o_website_form_required_custom #{error and 'portal_severity' in error and 'has-error' or ''}">
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="helpdesk_config_settings_inherit_maintenance">
<field name="name">res.config.settings.inherit.maintenance</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="after">
<div id="attention_maintenance">
<h2>Tiempos de Atención Mantenimiento</h2>
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="time_simple_alert_maintenance" />
<br />
<field name="time_simple_alert_maintenance" 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_maintenance" />
<br />
<field name="color_simple_alert_maintenance" 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_maintenance" />
<br />
<field name="time_medium_alert_maintenance" 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_maintenance" />
<br />
<field name="color_medium_alert_maintenance" 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_maintenance" />
<br />
<field name="time_extreme_alert_maintenance" 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_maintenance" />
<br />
<field name="color_extreme_alert_maintenance" class="oe_inline" widget="color_picker"/>
</div>
<div class="o_setting_left_pane"></div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="res_users_form_inherit_maintenance">
<field name="name">res.users.form.inherit.maintenance</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_res_users_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_portal_user_access']" position="before">
<field name="is_maintenance"/>
<field name="maintenance_position" attrs="{'invisible':[('is_maintenance', '=', False)],'required':[('is_maintenance','=',True)]}"/>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -15,10 +15,14 @@
"sh_all_in_one_helpdesk",
"vista_backend_theme",
"hide_odoo",
"account",
"crm",
"purchase",
"sale",
],
"data": [
'security/ir.model.access.csv',
'security/groups.xml',
#'security/groups.xml',
'data/region.xml',
'data/helpdesk_team.xml',
'data/helpdesk_stage.xml',
......@@ -34,7 +38,7 @@
'views/portal/portal_page.xml',
'views/portal/portal_feedback.xml',
'views/odoo/helpdesk_settings.xml',
#'views/odoo/helpdesk_ticket.xml',
'views/odoo/helpdesk_ticket.xml',
'views/odoo/helpdesk_team.xml',
'views/odoo/helpdesk_warehouse.xml',
'views/odoo/helpdesk_module.xml',
......
......@@ -5,18 +5,21 @@
<field name="name">SOPORTE TÉCNICO</field>
<field name="short_name">SOP</field>
<field name="team_head" ref="base.user_admin"/>
<field name="is_support_team" eval="True"/>
<field name="sh_resource_calendar_id" ref="resource.resource_calendar_std"/>
</record>
<record id="erp_asistense" model="helpdesk.team">
<field name="name">ASISTENCIA ERP</field>
<field name="short_name">ERP</field>
<field name="team_head" ref="base.user_admin"/>
<field name="is_support_team" eval="True"/>
<field name="sh_resource_calendar_id" ref="resource.resource_calendar_std"/>
</record>
<record id="ti_emergency" model="helpdesk.team">
<field name="name">TI 911</field>
<field name="short_name">911</field>
<field name="team_head" ref="base.user_admin"/>
<field name="is_support_team" eval="True"/>
<field name="sh_resource_calendar_id" ref="resource.resource_calendar_std"/>
</record>
......
......@@ -7,6 +7,7 @@ class HelpdeskTeamInherit(models.Model):
helpdesk_ticket_type_id = fields.Many2one('helpdesk.ticket.type','Tipo de ticket',copy=False)
short_name = fields.Char('Nombre corto',copy=False)
sequence_id = fields.Many2one('ir.sequence',string="Sequencia",copy=False)
is_support_team = fields.Boolean('Equipo de soporte')
@api.onchange(short_name)
......@@ -62,7 +63,7 @@ class HelpdeskTeamInherit(models.Model):
})
self.sequence_id = sequence.id
else:
self.sequence_id.prefix = self.short_name
self.sequence_id.prefix = self.short_name+"/"
\ No newline at end of file
......@@ -14,7 +14,6 @@ _logger = logging.getLogger(__name__)
class HelpdeskTicket(models.Model):
_inherit = 'helpdesk.ticket'
erp_id = fields.Many2one('erp.modules','ERP')
incidence_type = fields.Selection([
('odoo', 'Falla Odoo Nacional'),
......@@ -28,7 +27,7 @@ class HelpdeskTicket(models.Model):
('soporte','Soporte'),('mejora','Mejora')
],string="Tipo de asistencia")
ticket_reason = fields.Many2one('ticket.reason','Motivo de Ticket',
#default=lambda self: self.env.ref('helpdesk_morsa.reason_anything').id
default=lambda self: self.env['ticket.reason'].search([('name','=','Ninguno'),],limit=1).id
)
problem_solved_on_time = fields.Boolean('¿Solucionamos complementame tu problema?')
good_service_actitude = fields.Boolean('¿Ha sido buena nuestra actitud de Servicio?')
......@@ -36,9 +35,10 @@ class HelpdeskTicket(models.Model):
is_support = fields.Boolean('Es soporte',compute='_compute_ticket_type')
is_erp = fields.Boolean('Es ERP',compute='_compute_ticket_type')
is_emergency = fields.Boolean('Es 911',compute='_compute_ticket_type')
user_branch_id = fields.Many2one('warehouse.helpdesk',string='Usuario Sucursal',store=True)
#user_region_id = fields.Many2one('region.helpdesk',string="Región")
user_branch_id = fields.Many2one('warehouse.helpdesk', related="partner_id.user_ids.warehouse_id", string='Usuario Sucursal', store=True)
user_region_id = fields.Many2one('region.helpdesk', related="user_branch_id.region_id", string="Región", store=True,)
user_id = fields.Many2one('res.users',string="Usuario Asignado", tracking=True,domain="[('id','in',team_members)]")
team_members = fields.Many2many('res.users',relation="team_members_user_rel",related="team_id.team_members")
def _get_color(self):
in_progress_stage = self.env.ref('sh_all_in_one_helpdesk.in_progress_stage').id
......@@ -50,6 +50,9 @@ class HelpdeskTicket(models.Model):
extreme_time = float(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.time_extreme_alert'))
for rec in self:
if rec.team_head:
rec.color = 10
if rec.is_support == True or rec.is_erp == True or rec.is_emergency == True:
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]:
......@@ -59,6 +62,7 @@ class HelpdeskTicket(models.Model):
else:
rec.color = 10
@api.depends('team_id')
def _compute_ticket_type(self):
for ticket in self:
......@@ -174,18 +178,12 @@ class HelpdeskTicket(models.Model):
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:
template.sudo().send_mail(res.id, force_send=True)
if res.team_id and res.team_head and res.user_id and res.sh_user_ids:
if res.team_id and res.team_head and not res.user_id:
allocation_template = res.company_id.allocation_mail_template_id
email_formatted = []
if res.team_head.partner_id.email_formatted not in email_formatted:
email_formatted.append(
res.team_head.partner_id.email_formatted)
if res.user_id.partner_id.email_formatted not in email_formatted:
email_formatted.append(res.user_id.partner_id.email_formatted)
for user in res.sh_user_ids:
if user.id != res.user_id.id:
if user.partner_id.email_formatted not in email_formatted:
email_formatted.append(user.partner_id.email_formatted)
email_formatted_str = ','.join(email_formatted)
email_values = {
'email_from': str(res.team_head.partner_id.email_formatted),
......@@ -196,7 +194,7 @@ class HelpdeskTicket(models.Model):
force_send=True,
email_values=email_values)
res.ticket_allocated = True
elif res.team_id and res.team_head and res.user_id and not res.sh_user_ids:
elif res.team_id and res.team_head and res.user_id:
allocation_template = res.company_id.allocation_mail_template_id
email_formatted = []
if res.team_head.partner_id.email_formatted not in email_formatted:
......@@ -317,7 +315,7 @@ class HelpdeskTicket(models.Model):
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"))
if "description" in vals and vals['description'] != '<p><br></p>':
if "description" in vals and vals['description'] != '<p><br></p>' and (self.is_support == True or self.is_erp == True or self.is_emergency == True):
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"))
......
......@@ -7,22 +7,29 @@
<field name="implied_ids" eval="[(6,0,[ref('sh_all_in_one_helpdesk.helpdesk_group_user')])]"/>
</record>
<record id="captain_ti" model="res.groups">
<field name="category_id" ref="sh_all_in_one_helpdesk.module_helpdesk_category"/>
<field name="name">Capitan del Equipo TI</field>
<field name="implied_ids" eval="[(6,0,[ref('sh_all_in_one_helpdesk.helpdesk_group_team_leader'),ref('user_ti')])]"/>
</record>
<record id="admin_ti" model="res.groups">
<field name="category_id" ref="sh_all_in_one_helpdesk.module_helpdesk_category"/>
<field name="name">Administrador de TI</field>
<field name="implied_ids" eval="[(6,0,[ref('sh_all_in_one_helpdesk.helpdesk_group_manager'),ref('captain_ti')])]"/>
</record>
<record id="only_see_ti" model="ir.rule">
<field name="name">Ver tickets de TI</field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_ticket"/>
<field name="groups" eval="[(6,0,[ref('user_ti')])]"/>
<field name="groups" eval="[(6,0,[ref('user_ti'),ref('captain_ti'),ref('admin_ti'),])]"/>
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_create" eval="1"/>
<field name="perm_unlink" eval="0"/>
<field name="domain_force">
[('team_id','in',[ref('helpdesk_morsa.techinnical_support'),ref('helpdesk_morsa.erp_asistense'),ref('helpdesk_morsa.ti_emergency')])]
[('team_id.is_support_team','=',True)]
</field>
</record>
</data>
</odoo>
\ No newline at end of file
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
user_erp_modules,erp.modules.user,model_erp_modules,base.group_user,1,0,0,0
hlp_erp_modules,erp.modules.admin,model_erp_modules,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
admin_erp_modules,erp.modules.admin,model_erp_modules,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_warehouse_helpdesk,warehouse.helpdesk_user,model_warehouse_helpdesk,base.group_user,1,0,0,0
hlp_warehouse_helpdesk,warehouse.helpdesk.admin,model_warehouse_helpdesk,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,0,0,0
hlp_ticket_reason,ticket.reason.admin,model_ticket_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
admin_ticket_reason,ticket.reason.admin,model_ticket_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_region_helpdesk,region.helpdesk.user,model_region_helpdesk,base.group_user,,1,0,0,0
hlp_region_helpdesk,region.helpdesk.admin,model_region_helpdesk,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
\ No newline at end of file
admin_region_helpdesk,region.helpdesk.admin,model_region_helpdesk,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_account_move,account.move.user,account.model_account_move,sh_all_in_one_helpdesk.helpdesk_group_user,1,0,0,0
user_crm_lead,crm.lead.user,crm.model_crm_lead,sh_all_in_one_helpdesk.helpdesk_group_user,1,0,0,0
user_purchase_order,purchase.order.user,purchase.model_purchase_order,sh_all_in_one_helpdesk.helpdesk_group_user,1,0,0,0
user_sale_order,sale.order.user,sale.model_sale_order,sh_all_in_one_helpdesk.helpdesk_group_user,1,0,0,0
......@@ -15,3 +15,5 @@
background-color: #ff9409 !important;
border-color: #ff9409 !important;
}
......@@ -6,7 +6,9 @@
<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">
<xpath expr="//div[@id='ticket_settings']" position="after">
<div id="attention_ti">
<h2>Tiempos de Atención TI</h2>
<div class="row o_settings_container">
<div class="col-6 o_setting_box">
<div class="o_setting_right_pane">
......@@ -72,6 +74,7 @@
<div class="o_setting_left_pane"></div>
</div>
</div>
</div>
</xpath>
</field>
</record>
......
......@@ -7,10 +7,12 @@
<field name="inherit_id" ref="sh_all_in_one_helpdesk.helpdesk_ticket_form_view"/>
<field name="priority" eval="17"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='priority']" position="after">
<xpath expr="//field[@name='name']" position="after">
<field name="is_support" invisible="1"/>
<field name="is_erp" invisible="1"/>
<field name="is_emergency" invisible="1"/>
</xpath>
<xpath expr="//field[@name='priority']" position="after">
<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)]}"/>
......@@ -19,7 +21,7 @@
<xpath expr="//header" position="replace">
<header>
<button name="assign_me" type="object" string="Assignar a mi" class="oe_highlight" />
<button name="action_approve" type="object" string="Siguiente etapa" class="oe_highlight" attrs="{'invisible':['|',('cancel_stage_boolean','=',True),'|',('done_stage_boolean','=',True),('closed_stage_boolean','=',True)]}"/>
<button name="action_approve" type="object" string="Siguiente etapa" class="oe_highlight" attrs="{'invisible':['|','|',('cancel_stage_boolean','=',True),('done_stage_boolean','=',True),('closed_stage_boolean','=',True)]}"/>
<button name="action_reply" type="object" string="Respuesta" class="oe_highlight"/>
<button name="action_done" type="object" string="Resolver Ticket" class="oe_highlight" attrs="{'invisible':[('done_button_boolean','=',False)]}"/>
<button name="action_closed" type="object" string="Cerrar Ticket" class="oe_highlight" attrs="{'invisible':[('done_stage_boolean','=',False)]}"/>
......@@ -32,18 +34,7 @@
<xpath expr="//field[@name='tag_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sh_lead_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sh_invoice_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sh_sale_order_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sh_purchase_order_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='subject_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
......@@ -53,14 +44,64 @@
<field name="begin_before_ten_min"/>
</xpath>
<xpath expr="//field[@name='sub_category_id']" position="after">
<field name="ticket_reason" attrs="{'invisible':['|'('is_support', '=', False),'|',('is_erp', '=', False),('is_emergency', '=', False)]}"/>
<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>
</field>
</record>
<record id="helpdesk_sh_sale_form_inherit" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.inherit.sale</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_tickets_so_inherited_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_sale_order_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="helpdesk_sh_purchase_form_inherit" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.inherit.purchase</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_tickets_po_inherited_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_purchase_order_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="helpdesk_sh_invoice_form_inherit" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.inherit.invoice</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_tickets_invoice_inherited_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_invoice_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="helpdesk_sh_crm_form_inherit" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.inherit.crm</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_tickets_crm_inherited_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_lead_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="helpdesk_ticket_kanban_inherit_quick_create" model="ir.ui.view">
<field name="name">helpdesk.ticket.kanban.inherit</field>
......
......@@ -104,6 +104,8 @@
<div class="collapse" id="collapseImprove">
<div class="form-group">
<a href="/helpdesk_morsa/static/src/docs/TI-FOR-02_Solicitud_de_reportes_rev02.xlsx">Descargar solicutd de reporte</a>
</div>
<div class="form-group">
<a href="/helpdesk_morsa/static/src/docs/TI-FOR-04_Solicitud_de_Mejora_rev02.xlsx">Descargar solicutd de mejora</a>
</div>
......
$(document).ready(function(e) {
var card = document.getElementById('portal_cards');
if (Boolean(card) == true){
var cards = card.children;
if(cards.length == 1){
card.appendChild(newdiv1);
for (var i = 0; i <= cards.length; i++){
cards[i].classList.remove("col-lg-4");
......@@ -11,34 +11,16 @@ $(document).ready(function(e) {
}
if(cards.length == 2){
for (var i = 0; i <= cards.length; i++){
cards[i].classList.remove("col-lg-4");
cards[i].classList.add("col-lg-6");
}
}
}
});
/*var card = $('#portal_cards').children('div')
var cards = card.length;
if(cards == 1){
card.each(function (){
var element = $(this)
element.removeClass('col-lg-4');
element.addClass('col-lg-6');
element.addClass('o_center_object');
})
}else if(cards == 2){
card.each(function (){
var element = $(this)
element.removeClass('col-lg-4');
element.addClass('col-lg-6');
})
}*/
......
......@@ -26,7 +26,7 @@
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{ object.company_id.id }}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -124,7 +124,7 @@
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{object.company_id.id}}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -222,7 +222,7 @@
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{object.company_id.id}}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -318,7 +318,7 @@
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{object.company_id.id}}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -410,7 +410,7 @@
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{object.company_id.id}}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -502,7 +502,7 @@
</span>
</td>
<td valign="middle" align="right">
<img src="/logo.png?company={{object.company_id.id}}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="{{object.company_id.name}}" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" alt="{{object.company_id.name}}" />
</td>
</tr>
</table>
......@@ -599,7 +599,7 @@
</span>
</td>
<td valign="middle" align="right">
<img t-attf-src="/logo.png?company={{ object.company_id.id }}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="object.company_id.name" />
<img src="/sh_all_in_one_helpdesk/static/src/img/morsa_logo_white.png" style="padding: 0px; margin: 0px; height: auto; width: 180px;" t-att-alt="object.company_id.name" />
</td>
</tr>
</table>
......
......@@ -182,7 +182,8 @@ class HelpdeskTicket(models.Model):
team_head = fields.Many2one('res.users', "Team Head", tracking=True)
user_id = fields.Many2one('res.users',
string="Assigned User",
tracking=True)
tracking=True,
)
subject_id = fields.Many2one('helpdesk.sub.type',
string='Ticket Subject Type',
tracking=True)
......
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