Commit 74ee5e96 by Arturo Jasso Origel

ajuste en el ticket dashboard para filtrado de ticket de usuarios que tengan…

ajuste en el ticket dashboard para filtrado de ticket de usuarios que tengan permiso de admin, y corrección en el permiso de team_id
parent df7d1818
...@@ -215,12 +215,20 @@ class TicketDashboardInherit(models.Model): ...@@ -215,12 +215,20 @@ class TicketDashboardInherit(models.Model):
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:
if self.env.user.has_group(
if self.env.user.has_group('helpdesk_morsa.ticket_team_admin') and not self.env.user.has_group('sh_all_in_one_helpdesk.helpdesk_group_manager'):
doman.append(('|'))
doman.append(('team_admin_id','=',self.env.user.id))
doman.append(('team_id.team_members','in',[self.env.user.id]))
elif self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_team_leader' 'sh_all_in_one_helpdesk.helpdesk_group_team_leader'
) and self.env.user.has_group( ) and self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_user' 'sh_all_in_one_helpdesk.helpdesk_group_user'
) and not self.env.user.has_group( ) and not self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_manager' 'sh_all_in_one_helpdesk.helpdesk_group_manager'
) and not self.env.user.has_group(
'helpdesk_morsa.ticket_team_admin'
): ):
doman.append(('|')) doman.append(('|'))
doman.append(('|')) doman.append(('|'))
...@@ -241,14 +249,7 @@ class TicketDashboardInherit(models.Model): ...@@ -241,14 +249,7 @@ class TicketDashboardInherit(models.Model):
ticket_list = [] ticket_list = []
#CHANCE DOMAN #CHANCE DOMAN
if self.env.user.has_group('helpdesk_morsa.ticket_team_admin'):
doman = []
doman.append(('stage_id', '=', stage.id))
doman.append(('company_id','in',cids))
doman.append(('|'))
doman.append(('team_admin_id','=',self.env.user.id))
doman.append(('team_admin_id','=',False))
search_tickets = ticket_obj.search(doman) search_tickets = ticket_obj.search(doman)
if search_tickets: if search_tickets:
...@@ -471,13 +472,19 @@ class TicketDashboardInherit(models.Model): ...@@ -471,13 +472,19 @@ class TicketDashboardInherit(models.Model):
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:
if self.env.user.has_group(
if self.env.user.has_group('helpdesk_morsa.ticket_team_admin') and not self.env.user.has_group('sh_all_in_one_helpdesk.helpdesk_group_manager'):
doman.append(('|'))
doman.append(('team_admin_id','=',self.env.user.id))
doman.append(('team_id.team_members','in',[self.env.user.id]))
elif self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_team_leader' 'sh_all_in_one_helpdesk.helpdesk_group_team_leader'
) and self.env.user.has_group( ) and self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_user' 'sh_all_in_one_helpdesk.helpdesk_group_user'
) and not self.env.user.has_group( ) and not self.env.user.has_group(
'sh_all_in_one_helpdesk.helpdesk_group_manager' 'sh_all_in_one_helpdesk.helpdesk_group_manager'
): ) and not self.env.user.has_group('helpdesk_morsa.ticket_team_admin'):
doman.append(('|')) doman.append(('|'))
doman.append(('|')) doman.append(('|'))
doman.append(('sh_user_ids', 'in', [self.env.user.id])) doman.append(('sh_user_ids', 'in', [self.env.user.id]))
...@@ -499,13 +506,7 @@ class TicketDashboardInherit(models.Model): ...@@ -499,13 +506,7 @@ class TicketDashboardInherit(models.Model):
ticket_list = [] ticket_list = []
#CHANCE DOMAN #CHANCE DOMAN
if self.env.user.has_group('helpdesk_morsa.ticket_team_admin'):
doman = []
doman.append(('stage_id', '=', stage.id))
doman.append(('company_id','in',cids))
doman.append(('|'))
doman.append(('team_admin_id','=',self.env.user.id))
doman.append(('team_admin_id','=',False))
search_tickets = ticket_obj.search(doman) search_tickets = ticket_obj.search(doman)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<field name="name">Helpdesk Administrador del equipo</field> <field name="name">Helpdesk Administrador del equipo</field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_team" /> <field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_team" />
<field name="global" eval="True" /> <field name="global" eval="True" />
<field name="domain_force">['|','|',('team_admin_id','=',user.id),('team_admin_id','=',False)]</field> <field name="domain_force">['|',('team_admin_id','=',user.id),('team_admin_id','=',False)]</field>
<field name="groups" eval="[(4, ref('helpdesk_morsa.ticket_team_admin'))]" /> <field name="groups" eval="[(4, ref('helpdesk_morsa.ticket_team_admin'))]" />
</record> </record>
......
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