<?xml version="1.0" encoding="utf-8"?>
<odoo>


    <record id="project_timesheet_report_view_tree" model="ir.ui.view">
        <field name="name">project.timesheet.report.tree</field>
        <field name="model">project.timesheet.report</field>
        <field name="arch" type="xml">
            <tree string="Timesheet Report" create="false" edit="false" delete="false">
                <field name="start_date"/>
                <field name="employee_id"/>
                <field name="project_id"/>
                <field name="sub_project"/>
                <field name="task_id"/>
                <field name="duration"/>
                <field name="timestamp"/>
                <field name="start_time"/>
                <field name="end_time"/>
                <field name="description"/>
                <field name="start_datetime" invisible="1"/>
                <field name="end_datetime" invisible="1"/>
             </tree>
         </field>
    </record>


    <record id="project_timesheet_report_view_search" model="ir.ui.view">
        <field name="name">project.timesheet.report.search</field>
        <field name="model">project.timesheet.report</field>
        <field name="arch" type="xml">
            <search string="Timesheet Report">
                <field name="project_id"/>
                <field name="employee_id"/>
                <field name="start_date"/>
                <field name="task_id"/>
                <filter name="month" string="Start Time" date="start_date"/>
                <group expand="1" string="Group By">
                    <filter string="Project" name="project" context="{'group_by':'project_id'}"/>
                    <filter string="Employee" name="employee" context="{'group_by':'employee_id'}"/>
                    <filter string="Start Time" name="sdate" domain="[]" context="{'group_by':'start_date:month'}"/>
                    <filter string="Task" name="task" context="{'group_by':'task_id'}"/>
                    <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
                    <filter string="Active" name="active" domain="[('active', '=', True)]"/>
                </group>
            </search>
        </field>
    </record>

    <record id="project_timesheet_report_view_action" model="ir.actions.act_window">
        <field name="name">Timesheets Report</field>
        <field name="res_model">project.timesheet.report</field>
        <field name="view_mode">tree</field>
        <field name="search_view_id" ref="project_timesheet_report_view_search"/>
        <field name="context">{}</field>
    </record>

    <menuitem id="menu_project_timesheets_report"
        parent="hr_timesheet.menu_timesheets_reports_timesheet"
        action="project_timesheet_report_view_action"
        name="Timesheets Report"
        sequence="50"/>

</odoo>
