<?xml version="1.0" encoding="utf-8"?>
<openerp>
 <data>
          <menuitem
            id="hr.menu_hr_reporting"
            name="Human Resources"
            parent="base.menu_reporting"
            sequence="40" />

        <!-- Report for Users' Timesheet and Task Hours per Month -->

        <record id="view_report_timesheet_task_user_tree" model="ir.ui.view">
            <field name="name">report.timesheet.task.user.tree</field>
            <field name="model">report.timesheet.task.user</field>
            <field name="arch" type="xml">
                <tree string="Timesheet/Task hours Report Per Month" >
                    <field name="name"/>
                    <field name="year" invisible="1"/>
                    <field name="month" invisible="1"/>
                    <field name="user_id"/>
                    <field name="timesheet_hrs" widget="float_time" />
                    <field name="task_hrs"  widget="float_time"/>
                </tree>
            </field>
        </record>
      <record id="view_report_timesheet_task_user_search" model="ir.ui.view">
            <field name="name">report.timesheet.task.user.search</field>
            <field name="model">report.timesheet.task.user</field>
            <field name="arch" type="xml">
                <search string="Tasks by User">
                    <field name="name" string="Date"/>
                    <field name="user_id"/>
                    <group expand="1" string="Group By...">
                        <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
                        <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
                        <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="view_task_hour_per_month_graph" model="ir.ui.view">
            <field name="name">report.timesheet.task.user.graph</field>
            <field name="model">report.timesheet.task.user</field>
            <field name="arch" type="xml">
                <graph string="Task Hours Per Month" type="bar">
                     <field name="user_id"/>
                     <field name="task_hrs" operator="+"/>
                     <field name="timesheet_hrs" operator="+"/>
                 </graph>
            </field>
        </record>

        <record id="action_report_timesheet_task_user" model="ir.actions.act_window">
            <field name="name">Task Hours Per Month</field>
            <field name="res_model">report.timesheet.task.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,graph</field>
            <field name="context">{'search_default_year':1,'search_default_month':1, 'search_default_group_user_id':1}</field>
        </record>
        <menuitem id="menu_timesheet_task_user" parent="hr.menu_hr_reporting_timesheet"
                    action="action_report_timesheet_task_user" sequence="1"/>

    </data>
</openerp>
