Commit 7010b720 by Arturo Jasso Origel

se agregan permisos para el usuario de administrador, y se retira el filtro de…

se agregan permisos para el usuario de administrador, y se retira el filtro de los tickets que se encuentran hechos o cancelados
parent e4d6e32a
...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk): ...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk):
def _prepare_portal_layout_values(self): def _prepare_portal_layout_values(self):
values = super(PortalHelpdesk, self)._prepare_portal_layout_values() values = super(PortalHelpdesk, self)._prepare_portal_layout_values()
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain = [('stage_id.id','not in',[stage_close,stage_done,stage_cancel])] ticket_domain = []
if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user': if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user':
...@@ -238,10 +235,7 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk): ...@@ -238,10 +235,7 @@ class PortalHelpdeskMorsaEmergency(PortalHelpdesk):
ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id])) ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id]))
ticket_domain.append( ticket_domain.append(
('partner_id', '=', request.env.user.partner_id.id)) ('partner_id', '=', request.env.user.partner_id.id))
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain.append(('stage_id.id','not in',[stage_close,stage_done,stage_cancel]))
domain = AND([domain, ticket_domain]) domain = AND([domain, ticket_domain])
# count for pager # count for pager
......
...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
def _prepare_portal_layout_values(self): def _prepare_portal_layout_values(self):
values = super(PortalHelpdesk, self)._prepare_portal_layout_values() values = super(PortalHelpdesk, self)._prepare_portal_layout_values()
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain = [('stage_id.id','not in',[stage_close,stage_done,stage_cancel])] ticket_domain = []
if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user': if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user':
...@@ -247,10 +244,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk): ...@@ -247,10 +244,7 @@ class PortalHelpdeskMorsaErp(PortalHelpdesk):
ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id])) ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id]))
ticket_domain.append( ticket_domain.append(
('partner_id', '=', request.env.user.partner_id.id)) ('partner_id', '=', request.env.user.partner_id.id))
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain.append(('stage_id.id','not in',[stage_close,stage_done,stage_cancel]))
domain = AND([domain, ticket_domain]) domain = AND([domain, ticket_domain])
# count for pager # count for pager
......
...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk): ...@@ -21,11 +21,8 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
def _prepare_portal_layout_values(self): def _prepare_portal_layout_values(self):
values = super(PortalHelpdesk, self)._prepare_portal_layout_values() values = super(PortalHelpdesk, self)._prepare_portal_layout_values()
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain = [('stage_id.id','not in',[stage_close,stage_done,stage_cancel])] ticket_domain = []
if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user': if request.env.user.sh_portal_user_access and request.env.user.sh_portal_user_access == 'user':
...@@ -246,18 +243,11 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk): ...@@ -246,18 +243,11 @@ class PortalHelpdeskMorsaSoporte(PortalHelpdesk):
ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id])) ticket_domain.append(('sh_user_ids', 'in', [request.env.user.id]))
ticket_domain.append( ticket_domain.append(
('partner_id', '=', request.env.user.partner_id.id)) ('partner_id', '=', request.env.user.partner_id.id))
stage_close = request.env.ref('sh_all_in_one_helpdesk.close_stage').id
stage_done = request.env.ref('sh_all_in_one_helpdesk.done_stage').id
stage_cancel = request.env.ref('sh_all_in_one_helpdesk.cancel_stage').id
ticket_domain.append(('stage_id.id','not in',[stage_close,stage_done,stage_cancel]))
domain = AND([domain, ticket_domain]) domain = AND([domain, ticket_domain])
support_count = len(HelpdeskTicket.search(domain).filtered(lambda h: h.team_id.id == request.env.ref('helpdesk_morsa.techinnical_support').id)) support_count = len(HelpdeskTicket.search(domain).filtered(lambda h: h.team_id.id == request.env.ref('helpdesk_morsa.techinnical_support').id))
# pager # pager
pager = portal_pager(url="/my/soporte",url_args={'sortby': sortby,'search_in': search_in,'search': search,'filterby': filterby},total=support_count,page=page,step=self._items_per_page) pager = portal_pager(url="/my/soporte",url_args={'sortby': sortby,'search_in': search_in,'search': search,'filterby': filterby},total=support_count,page=page,step=self._items_per_page)
if groupby == 'create_by': if groupby == 'create_by':
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<record id="ticket_auditor" 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="category_id" ref="sh_all_in_one_helpdesk.module_helpdesk_category"/>
<field name="name">Auditor de tickets</field> <field name="name">Auditor de tickets</field>
<field name="menu_access" eval="[(4,ref('sh_all_in_one_helpdesk.helpdesk_main_menu'))]"/>
</record> </record>
...@@ -40,7 +41,17 @@ ...@@ -40,7 +41,17 @@
<field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_team_leader'))]" /> <field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_team_leader'))]" />
</record> </record>
<record model="ir.rule" id="helpdesk_ticket_auditor">
<field name="name">Auditor </field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_ticket" />
<field name="global" eval="False" />
<field name="domain_force">[('1','=',1)]</field>
<field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_manager'))]" />
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="0"/>
<field name="perm_create" eval="0"/>
<field name="perm_unlink" eval="0"/>
</record>
</data> </data>
</odoo> </odoo>
\ No newline at end of file
...@@ -41,4 +41,6 @@ auditor_erp_system,erp.system.auditor,model_erp_system,helpdesk_morsa.ticket_aud ...@@ -41,4 +41,6 @@ auditor_erp_system,erp.system.auditor,model_erp_system,helpdesk_morsa.ticket_aud
auditor_region_helpdesk,region.helpdesk.auditor,model_region_helpdesk,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_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 auditor_warehouse_helpdesk,warehouse.helpdesk.auditor,model_warehouse_helpdesk,helpdesk_morsa.ticket_auditor,1,0,0,0
auditor_account_analytic_line,account.analytic.line.auditor,account.model_account_analytic_line,helpdesk_morsa.ticket_auditor,1,0,0,0
access_auditor_ticket_assign,auditor.ticket.assign,model_user_ticket_assign,helpdesk_morsa.ticket_auditor,1,0,0,0
acces_auditor_crm_lead,auditor.crm.lead,crm.model_crm_lead,helpdesk_morsa.ticket_auditor,1,0,0,0
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<field name="priority" eval="17"/> <field name="priority" eval="17"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//header" position="replace"> <xpath expr="//header" position="replace">
<header> <header groups="sh_all_in_one_helpdesk.helpdesk_group_user">
<button name="ticket_change_type" type="object" string="Cambiar tipo de ticket" class="oe_highlight"/> <button name="ticket_change_type" type="object" string="Cambiar tipo de ticket" class="oe_highlight"/>
<button name="assign_me" type="object" string="Asignarme" class="oe_highlight"/> <button name="assign_me" type="object" string="Asignarme" 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)]}"/>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<label for="user_id"/> <label for="user_id"/>
<div class="o_row oe_inline"> <div class="o_row oe_inline">
<field name="user_id" widget="many2one"/> <field name="user_id" widget="many2one"/>
<button name="ticket_change_user" type="object" icon="fa-user" class="btn-primary"/> <button name="ticket_change_user" type="object" icon="fa-user" class="btn-primary" groups="sh_all_in_one_helpdesk.helpdesk_group_user"/>
</div> </div>
<field name="category_id"/> <field name="category_id"/>
<field name="priority"/> <field name="priority"/>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_ticket_time_inherit_kanban_view" /> <field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_helpdesk_ticket_time_inherit_kanban_view" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//button[@name='action_ticket_start']" position="replace"> <xpath expr="//button[@name='action_ticket_start']" position="replace">
<button name="open_form_change_user" type="object" string="Asignarme" class="btn-primary">Asignarme</button> <button name="open_form_change_user" type="object" string="Asignarme" class="btn-primary" groups="sh_all_in_one_helpdesk.helpdesk_group_user">Asignarme</button>
</xpath> </xpath>
<xpath expr="//button[@name='action_ticket_end']" position="replace"> <xpath expr="//button[@name='action_ticket_end']" position="replace">
......
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