341 lines
18 KiB
XML
341 lines
18 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
|
|
|
|
<!-- main menu modification -->
|
|
<record id="helpdesk_manager_ticket_action_main_tree" model="ir.actions.act_window">
|
|
<field name="name">All Tickets</field>
|
|
<field name="res_model">odex25_helpdesk.ticket</field>
|
|
<field name="view_mode">tree,kanban,form</field>
|
|
<field name="search_view_id" ref="odex25_helpdesk.odex25_helpdesk_tickets_view_search"/>
|
|
<field name="context">{'search_default_my_ticket': True}</field>
|
|
<field name="help" type="html">
|
|
<p>
|
|
No tickets to display.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<menuitem id="odex25_helpdesk_ticket_action_main_my_tree"
|
|
action="helpdesk_manager_ticket_action_main_tree"
|
|
sequence="10" parent="odex25_helpdesk.menu_odex25_helpdesk_root"/>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_main_my" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid)]</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_main_tree" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid)]</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_my_ticket_action_no_create" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid)]</field>
|
|
</record>
|
|
|
|
|
|
<!-- my ticket average hours action -->
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_dashboard" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('stage_id.is_close', '=', False)]</field>
|
|
</record>
|
|
<!-- my tickets average hours based on periority actions -->
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_dashboard" model="ir.actions.act_window">
|
|
<field name="domain">[('stage_id.is_close', '=', False),('user_id','=',uid),('priority', '=', '2')]</field>
|
|
</record>
|
|
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_sla" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('priority', '!=', False)]</field>
|
|
</record>
|
|
|
|
|
|
<!-- My performance actions -->
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_close_analysis" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('close_date', '>=', (datetime.datetime.today() -
|
|
datetime.timedelta(hours=15)).strftime('%Y-%m-%d %H:%M:%S'))]
|
|
</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_success" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('close_date', '>=', (datetime.datetime.today() -
|
|
datetime.timedelta(hours=15)).strftime('%Y-%m-%d %H:%M:%S'))]
|
|
</field>
|
|
</record>
|
|
<!-- 7 days avarage -->
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_7days_analysis" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('close_date', '>=', (datetime.datetime.today() -
|
|
datetime.timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S'))]
|
|
</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_7dayssuccess" model="ir.actions.act_window">
|
|
<field name="domain">[('user_id','=',uid),('close_date', '>=', (datetime.datetime.today() -
|
|
datetime.timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S'))]
|
|
</field>
|
|
</record>
|
|
|
|
<!-- in kanban, the Archived and SLA faild actions domained -->
|
|
<record id="odex25_helpdesk.helpdesk_ticket_action_Archived" model="ir.actions.act_window">
|
|
<field name="domain">['|',('team_id.member_ids' , 'in' , uid),('team_id.member_ids' , '=' ,False)]</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.helpdesk_ticket_action_slafailed" model="ir.actions.act_window">
|
|
<field name="domain">['|',('team_id.member_ids' , 'in' , uid),('team_id.member_ids' , '=' ,False)]</field>
|
|
</record>
|
|
<!-- reports in kanban domained -->
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_team_analysis_action" model="ir.actions.act_window">
|
|
<field name="domain">['|',('team_id.member_ids' , 'in' , uid),('team_id.member_ids' , '=' ,False)]</field>
|
|
</record>
|
|
<record id="odex25_helpdesk.odex25_helpdesk_ticket_action_team_performance" model="ir.actions.act_window">
|
|
<field name="domain">['|',('team_id.member_ids' , 'in' , uid),('team_id.member_ids' , '=' ,False)]</field>
|
|
</record>
|
|
|
|
<!--
|
|
here start separate normal user menues and actions and give the
|
|
helpdesk manager the original access;
|
|
-->
|
|
<!-- normal user -->
|
|
<record id="action_upcoming_sla_fail_all_tickets_normal_user" model="ir.actions.act_window">
|
|
<field name="name">Tickets</field>
|
|
<field name="res_model">odex25_helpdesk.ticket</field>
|
|
<field name="view_mode">kanban,tree,form,pivot,graph</field>
|
|
<field name="search_view_id" ref="odex25_helpdesk.odex25_helpdesk_tickets_view_search"/>
|
|
<field name="context">{'search_default_upcoming_sla_fail': True}</field>
|
|
<field name="domain">[('user_id','=',uid)]</field>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
Click create a new ticket.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="helpdesk_ticket_action_unassigned_normal_user" model="ir.actions.act_window">
|
|
<field name="name">Tickets</field>
|
|
<field name="res_model">odex25_helpdesk.ticket</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="context">{'search_default_team_id': active_id, 'search_default_unassigned': True}</field>
|
|
<field name="domain">[('user_id','=',uid)]</field>
|
|
<field name="search_view_id" ref="odex25_helpdesk.odex25_helpdesk_tickets_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
Click create a new ticket.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="helpdesk_team_dashboard_normal_user_action_main" model="ir.actions.act_window">
|
|
<field name="name">Dashboard</field>
|
|
<field name="res_model">odex25_helpdesk.team</field>
|
|
<field name="view_mode">kanban,form</field>
|
|
<field name="context">{}</field>
|
|
<field name="domain">['|',('member_ids','in',uid),'|',('team_leader_id','=',uid),'&',('team_leader_id','=',False),('member_ids','=',False)]</field>
|
|
<field name="view_id" ref="odex25_helpdesk.odex25_helpdesk_team_view_kanban"/>
|
|
<field name="help" type="html">
|
|
<p>
|
|
Your teams will appear here.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<menuitem id="menu_helpdesk_normal_user_root" name="Helpdesk"
|
|
sequence="26"
|
|
action="helpdesk_team_dashboard_normal_user_action_main"
|
|
web_icon="odex25_helpdesk,static/description/icon.png"
|
|
groups="group_helpdesk_normal_user"/>
|
|
|
|
|
|
<record id="helpdesk_ticket_normal_user_action_main_tree" model="ir.actions.act_window">
|
|
<field name="name">All Tickets</field>
|
|
<field name="res_model">odex25_helpdesk.ticket</field>
|
|
<field name="view_mode">tree,kanban,form</field>
|
|
<field name="search_view_id" ref="odex25_helpdesk.odex25_helpdesk_tickets_view_search"/>
|
|
<field name="context">{'search_default_my_ticket': True}</field>
|
|
<field name="domain">['|',('user_id','=',uid),('team_leader_id','=',uid)]</field>
|
|
<field name="help" type="html">
|
|
<p>
|
|
No tickets to display.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<menuitem id="helpdesk_ticket_normal_user_menu_main" action="helpdesk_ticket_normal_user_action_main_tree"
|
|
sequence="10" parent="menu_helpdesk_normal_user_root" groups="group_helpdesk_normal_user"/>
|
|
|
|
<menuitem id="helpdesk_menu_team_normal_user_dashboard" action="helpdesk_team_dashboard_normal_user_action_main"
|
|
sequence="5" parent="menu_helpdesk_normal_user_root"
|
|
groups="group_helpdesk_normal_user"/>
|
|
|
|
<menuitem id="ticket_report_menu_main" name="Reporting" sequence="15" parent="menu_helpdesk_normal_user_root"
|
|
groups="group_helpdesk_normal_user_manager"/>
|
|
|
|
<menuitem id="helpdesk_ticket_report_menu" name="Tickets"
|
|
action="odex25_helpdesk.odex25_helpdesk_ticket_analysis_action"
|
|
sequence="10" parent="ticket_report_menu_main" groups="group_helpdesk_normal_user_manager"/>
|
|
|
|
<menuitem id="menu_sla_analysis" name="SLA Status Analysis"
|
|
action="odex25_helpdesk.odex25_helpdesk_sla_report_analysis_action"
|
|
sequence="12" parent="ticket_report_menu_main" groups="group_helpdesk_normal_user_manager"/>
|
|
|
|
|
|
<!-- <record model='ir.ui.menu' id='odex25_helpdesk.odex25_helpdesk_ticket_report_menu_main'>-->
|
|
<!-- <field name="groups_id" eval="[(4,ref('odex25_helpdesk_security.group_helpdesk_normal_user_manager'))]"/>-->
|
|
<!-- </record>-->
|
|
|
|
|
|
<!-- action for halpdask team ticket in kanban user -->
|
|
<record id="helpdesk_ticket_action_team_user" model="ir.actions.act_window">
|
|
<field name="name">Tickets</field>
|
|
<field name="res_model">odex25_helpdesk.ticket</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="context">{'search_default_my_ticket': True}</field>
|
|
<field name="domain">['|',('user_id','=',uid),('team_leader_id','=',uid),('team_id', '=', active_id)]</field>
|
|
<field name="search_view_id" ref="odex25_helpdesk.odex25_helpdesk_tickets_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
Click create a new ticket.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="helpdesk_team_normal_user_view_kanban" model="ir.ui.view">
|
|
<field name="name">helpdesk.team.dashboard</field>
|
|
<field name="model">odex25_helpdesk.team</field>
|
|
<field name="inherit_id" ref="odex25_helpdesk.odex25_helpdesk_team_view_kanban"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div/button[1]' position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[1]' position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[2]' position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[3]' position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[4]' position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[1]' position="after">
|
|
<a name="%(odex25_helpdesk_security.action_upcoming_sla_fail_all_tickets_normal_user)d"
|
|
groups="odex25_helpdesk_security.group_helpdesk_normal_user"
|
|
type="action" context="{'search_default_my_ticket': True, 'default_team_id': active_id}">
|
|
<t t-esc="record.upcoming_sla_fail_tickets.raw_value"/>
|
|
Tickets to Review
|
|
</a>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div[2]/div[2]' position="after">
|
|
<a name="%(odex25_helpdesk_security.helpdesk_ticket_action_unassigned_normal_user)d" type="action"
|
|
groups="odex25_helpdesk_security.group_helpdesk_normal_user"
|
|
context="{'search_default_team_id': active_id, 'default_team_id': active_id}">
|
|
<t t-esc="record.unassigned_tickets.raw_value"/>
|
|
Unassigned Tickets
|
|
</a>
|
|
</xpath>
|
|
<xpath expr='//kanban/templates/t/div/div[2]/div/div/button[1]' position="after">
|
|
<button class="btn btn-primary" groups="odex25_helpdesk_security.group_helpdesk_normal_user"
|
|
name="%(helpdesk_ticket_action_team_user)d" type="action">Tickets
|
|
</button>
|
|
</xpath>
|
|
<xpath expr="//kanban/templates/t/div/div[3]/div/div[2]" position="attributes">
|
|
<attribute name="groups">
|
|
odex25_helpdesk_security.group_helpdesk_normal_user_manager,odex25_helpdesk_security.group_helpdesk_normal_manager
|
|
</attribute>
|
|
</xpath>
|
|
<xpath expr="//kanban/templates/t/div/div[3]/div[2]" position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="helpdesk_ticket_view_normal_kanban" model="ir.ui.view">
|
|
<field name="name">helpdesk.ticket.kanban</field>
|
|
<field name="model">odex25_helpdesk.ticket</field>
|
|
<field name="inherit_id" ref="odex25_helpdesk.odex25_helpdesk_ticket_view_kanban"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//kanban/templates/t/div/div[1]" position="attributes">
|
|
<attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>
|
|
</xpath>
|
|
<!-- <xpath expr="//kanban/templates/t/div/div[1]/ul/li[2]" position="attributes">-->
|
|
<!-- <attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>-->
|
|
<!-- </xpath>-->
|
|
<!-- <xpath expr="//kanban/templates/t/div/div[1]/ul/t[1]" position="attributes">-->
|
|
<!-- <attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>-->
|
|
<!-- </xpath>-->
|
|
<!-- <xpath expr="//kanban/templates/t/div/div[1]/ul/t[2]" position="attributes">-->
|
|
<!-- <attribute name="groups">odex25_helpdesk_security.group_helpdesk_normal_manager</attribute>-->
|
|
<!-- </xpath>-->
|
|
</field>
|
|
</record>
|
|
|
|
<!-- original -->
|
|
<record model="ir.ui.menu" id="odex25_helpdesk.menu_odex25_helpdesk_root">
|
|
<field name="groups_id" eval="[(6,0, [ref('odex25_helpdesk_security.group_helpdesk_normal_manager')])]"/>
|
|
</record>
|
|
|
|
<record model="ir.ui.menu" id="odex25_helpdesk.odex25_helpdesk_ticket_menu_main">
|
|
<!-- <field name="action">odex25_helpdesk_security.helpdesk_manager_ticket_action_main_tree</field> -->
|
|
<field name="groups_id" eval="[(6,0, [ref('odex25_helpdesk_security.group_helpdesk_normal_manager')])]"/>
|
|
</record>
|
|
|
|
<!-- prevent normal users from editing the stage -->
|
|
<record id="helpdesk_stage_readonly_view_form" model="ir.ui.view">
|
|
<field name="name">helpdesk.stage.reopen.form</field>
|
|
<field name="model">odex25_helpdesk.stage</field>
|
|
<field name="inherit_id" ref="odex25_helpdesk.odex25_helpdesk_stage_view_form"/>
|
|
<field name="groups_id" eval="[ (4, ref('odex25_helpdesk_security.group_helpdesk_normal_user'))]"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='name']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='sequence']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='team_ids']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
<attribute name="options">{'no_open' : True}</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='template_id']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
<attribute name="options">{'no_open' : True}</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='is_close']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='fold']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- prevent normal users from editing the stage -->
|
|
<record id="helpdesk_stage_readonly_reopen_view_form" model="ir.ui.view">
|
|
<field name="name">odex25_helpdesk.stage.reopen.form</field>
|
|
<field name="model">odex25_helpdesk.stage</field>
|
|
<field name="inherit_id" ref="odex25_helpdesk_reopen.helpdesk_stage_reopen_view_form"/>
|
|
<field name="groups_id" eval="[ (4, ref('odex25_helpdesk_security.group_helpdesk_normal_user'))]"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='is_reopen']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='reopen_time']" position="attributes">
|
|
<attribute name="readonly">1</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<template id="mail.message_user_assigned">
|
|
<p>Dear<t t-esc="object.user_id.sudo().name"/>,
|
|
</p>
|
|
|
|
<p>You have been assigned to the
|
|
<t t-esc="object.env['ir.model']._get(object._name).name.lower()"/>
|
|
<t t-esc="object.name_get()[0][1]"/>
|
|
.
|
|
</p>
|
|
<p>
|
|
<a groups="odex25_helpdesk_security.group_helpdesk_normal_manager,odex25_helpdesk_security.group_helpdesk_normal_user"
|
|
t-att-href="'/mail/view?model=%s&res_id=%s' % (object._name, object.id)"
|
|
style="background-color: #3E5D7F; margin-top: 10px; padding: 10px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;">
|
|
View
|
|
<t t-esc="object.env['ir.model']._get(object._name).name.lower()"/>
|
|
</a>
|
|
</p>
|
|
</template>
|
|
|
|
|
|
</odoo>
|