Commit d665d15f by Arturo Jasso Origel

se agregaron cambios y permisos

parent 34a518c5
......@@ -21,8 +21,8 @@
"sale",
],
"data": [
'security/groups.xml',
'security/ir.model.access.csv',
#'security/groups.xml',
'data/region.xml',
'data/helpdesk_team.xml',
'data/helpdesk_stage.xml',
......
......@@ -320,12 +320,14 @@ class HelpdeskTicket(models.Model):
})
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"))
if 'description' in vals and vals["description"] != "" and vals['description'] != '<p><br></p>' and (self.is_support == True or self.is_erp == True or self.is_emergency == True):
if 'description' in vals and (vals["description"] != "" or self.description != False)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:
description = self.get_description_len(vals["description"])
if len(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)
......@@ -336,6 +338,12 @@ class HelpdeskTicket(models.Model):
else:
return super(HelpdeskTicket, self).action_approve()
def get_description_len(self,description):
try:
return len(description)
except Exception as e:
return 0
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="user_ti" model="res.groups">
<field name="category_id" ref="sh_all_in_one_helpdesk.module_helpdesk_category"/>
<field name="name">Usuario de TI</field>
<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">
<record id="ticket_auditor" 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')])]"/>
<field name="name">Auditor de tickets</field>
</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'),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.is_support_team','=',True)]
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -12,9 +12,27 @@ user_region_helpdesk,region.helpdesk.user,model_region_helpdesk,base.group_user,
admin_region_helpdesk,region.helpdesk.admin,model_region_helpdesk,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_erp_system,erp.system.user,model_erp_system,base.group_user,,1,0,0,0
admin_erp_system,region.helpdes.admin,model_erp_system,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
admin_erp_system,erp.system.admin,model_erp_system,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
auditor_helpdesk_ticket,helpdeks.ticket.auditor,sh_all_in_one_helpdesk.model_helpdesk_ticket,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_category,helpdesk_category.auditor,sh_all_in_one_helpdesk.model_helpdesk_category,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_team,helpdeks.team.auditor,sh_all_in_one_helpdesk.model_helpdesk_team,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_stages,helpdeks.stages.auditor,sh_all_in_one_helpdesk.model_helpdesk_stages,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_tags,helpdeks.tags.auditor,sh_all_in_one_helpdesk.model_helpdesk_tags,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_priority,helpdeks.priority.auditor,sh_all_in_one_helpdesk.model_helpdesk_priority,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_subcategory,helpdeks.subcategory.auditor,sh_all_in_one_helpdesk.model_helpdesk_subcategory,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_ticket_dashboard,ticket.dashboard.auditor,sh_all_in_one_helpdesk.model_ticket_dashboard,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_sub_type,helpdesk.sub.type.auditor,sh_all_in_one_helpdesk.model_helpdesk_sub_type,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_helpdesk_ticket_type,helpdeks.ticket.type.auditor,sh_all_in_one_helpdesk.model_helpdesk_ticket_type,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_erp_modules,erp.modules.auditor,model_erp_modules,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_erp_system,erp.system.auditor,model_erp_system,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_region_helpdesk,region.helpdesk.auditor,model_region_helpdesk,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_ticket_reason,ticket.reason.auditor,model_ticket_reason,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_warehouse_helpdesk,warehouse.helpdesk.auditor,model_warehouse_helpdesk,helpdesk_morsa.ticket_auditor,1,0,0,0
......@@ -141,7 +141,7 @@
<em t-else="">Ticket</em>
</a>
</td>
<td><span t-field="t.create_date" t-options='{"widget": "date"}' /></td>
<td><span t-field="t.create_date"/></td>
<td><span t-field="t.write_date" t-options='{"widget": "date"}' /></td>
<td><span t-field="t.ticket_type" /></td>
<td><span t-field="t.stage_id" /></td>
......
......@@ -214,6 +214,7 @@
</th>
<th>Fecha de creación</th>
<th>Última actualización</th>
<th>Prioridad</th>
<th>Módulo</th>
<th>Sucursal</th>
<th>Estado</th>
......@@ -228,8 +229,9 @@
<em t-else="">Ticket</em>
</a>
</td>
<td><span t-field="t.create_date" t-options='{"widget": "date"}' /></td>
<td><span t-field="t.create_date"/></td>
<td><span t-field="t.write_date" t-options='{"widget": "date"}' /></td>
<td><span t-field="t.priority"/></td>
<td><span t-field="t.erp_id" /></td>
<td><span t-field="t.warehouse_id" /></td>
<td><span t-field="t.stage_id" /></td>
......
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