[MERGE] new livechat web module chs
[odoo/odoo.git] / addons / crm_helpdesk / report / crm_helpdesk_report_view.xml
index 125f977..6a4ab3e 100644 (file)
                     <field name="planned_cost"/>
                     <field name="state" invisible="1"/>
                     <field name="day" invisible="1"/>
-                    <field name="canal_id" invisible="1"/>
+                    <field name="channel_id" invisible="1"/>
                 </tree>
             </field>
         </record>
 
-<!-- Helpdesk report after Sales Services Form View -->
-
-        <record id="view_report_crm_helpdesk_form" model="ir.ui.view">
-            <field name="name">crm.helpdesk.report.form</field>
-            <field name="model">crm.helpdesk.report</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <form string="Cases">
-                    <field name="name" select="1"/>
-                    <field name="month" select="1"/>
-                    <field name="user_id" select="1"/>
-                    <field name="section_id" select="1"/>
-                    <field name="nbr" select="1"/>
-                    <field name="delay_close"/>
-                    <field name="amount_revenue"/>
-                    <field name="amount_revenue_prob"/>
-                    <field name="probability"/>
-                    <field name="state" select="1"/>
-                </form>
-            </field>
-        </record>
-
 <!-- Helpdesk report after Sales Services Graph View -->
 
         <record id="view_report_crm_helpdesk_graph" model="ir.ui.view">
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search">
-                    <group col="16" colspan="9">
+                    <group>
                         <filter string="  Year  " icon="terp-go-year"
                             domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;=',time.strftime('%%Y-01-01'))]"
                             help="Helpdesk requests occurred in current year"/>
                         <filter string="   Month   " icon="terp-go-month" name="this_month"
-                            domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;=',time.strftime('%%Y-%%m-01'))]"
+                            domain="[('create_date','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
                             help="Helpdesk requests occurred in current month"/>
-                        <filter icon="terp-go-month" string="    Month-1    " separator="1"
-                            domain="[('create_date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
+                        <filter icon="terp-go-month" string="    Month-1    " 
+                            domain="[('create_date','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
                             help="Helpdesk requests occurred in last month"/>
                         <separator orientation="vertical" />
-                        <filter string="Current" icon="terp-check"
-                        domain="[('state','in',('open','draft'))]" />
-                        <filter string="Won" icon="terp-check"
-                        domain="[('state','=','done')]" />
-                        <filter string="Lost" icon="terp-dialog-close"
+                        <filter string="New" icon="terp-check"
+                        domain="[('state','=','draft')]" />
+                        <filter string="Open" icon="terp-camera_test"
+                        domain="[('state','=','open')]" />
+                        <filter string="Closed" icon="terp-dialog-close"
                         domain="[('state','=','cancel')]" />
                         <separator orientation="vertical" />
                         <field name="section_id" string="Sales Team"
-                            default="context.get('section_id', False)"
                             context="{'invisible_section': False}">
                             <filter icon="terp-personal+" groups="base.group_extended"
                             context="{'invisible_section': False}"
                             domain="[('section_id.user_id','=',uid)]"
                             help="My Sales Team(s)" />
                         </field>
-                        <field name="company_id">
+                        <field name="company_id" groups="base.group_multi_company">
                             <filter icon="terp-go-home"
                             context="{'invisible_section': False}"
                             domain="[('section_id.user_id.company_id','=',uid)]"
                     <newline/>
                     <group expand="1" string="Group By...">
                         <filter string="Salesman" icon="terp-personal"
-                            domain="[]" context="{'group_by':'user_id'}"
-                            default="1" />
+                            domain="[]" context="{'group_by':'user_id'}"/>
                         <filter string="Sales Team" icon="terp-personal+"
                             domain="[]"
                             context="{'group_by':'section_id'}" />
                             domain="[]"
                             context="{'group_by':'partner_id'}" />
                         <separator orientation="vertical" />
-                        <filter string="Channel" icon="terp-call-start"
-                            domain="[]"
-                        context="{'group_by':'canal_id'}" />
+                        <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
                         <separator orientation="vertical" />
                         <filter string="State" icon="terp-stock_effects-object-colorize"
                             domain="[]" context="{'group_by':'state'}" />
                         <separator orientation="vertical" />
                         <filter string="Company" icon="terp-go-home" 
                             domain="[]"
+                            groups="base.group_multi_company"
                             context="{'group_by':'company_id'}" />
-                        <separator orientation="vertical" />
+                        <separator orientation="vertical" groups="base.group_multi_company"/>
                         <filter string="Day" icon="terp-go-today"
                             domain="[]" context="{'group_by':'day'}" help="Date of helpdesk requests"/>
                         <filter string="Month" icon="terp-go-month"
             <field name="res_model">crm.helpdesk.report</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,graph</field>
-            <field name="context">{"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}</field>
+            <field name="context">{"search_default_User":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}</field>
             <field name="view_id" ref="view_report_crm_helpdesk_tree"/>
             <field name="search_view_id" ref="view_report_crm_helpdesk_filter"/>
-            <field name="help">Helpdesk allows you to consult different informations relative to support demands. Check for treatments delays, number of responses given and emails send and costs. You can sort out your analysis on different groups to get fine grained analysis.</field>
+            <field name="help">Have a general overview of all support requests by sorting them with specific criteria such as the processing time, number of requests answered, emails sent and costs.</field>
         </record>
 
            <record model="ir.actions.act_window.view" id="action_report_crm_helpdesk_tree">