<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        
        <!-- Statistics report on timesheet by user -->
        
        <record id="view_timesheet_user_graph" model="ir.ui.view">
            <field name="name">report_timesheet.user.graph</field>
            <field name="model">report_timesheet.user</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Timesheet by user" type="bar">
                    <field name="name"/>
                    <field name="quantity" operator="+"/>
                    <field group="True" name="user_id"/>
                </graph>
            </field>
        </record>
        
        
        <record id="view_timesheet_user_form" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.user.form</field>
            <field name="model">report_timesheet.user</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Timesheet by user">
                    <field name="name" select="1"/>
                    <field name="user_id" select="1"/>
                </form>
            </field>
        </record>
        
        
        <record id="view_timesheet_user_tree" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.user.tree</field>
            <field name="model">report_timesheet.user</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Timesheet by user">
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="quantity"/>
                    <field name="cost"/>
                </tree>
            </field>
        </record>
        
        <record id="action_timesheet_user_stat" model="ir.actions.act_window">
            <field name="name">Timesheet by user (this month)</field>
            <field name="res_model">report_timesheet.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="domain">[('name','&gt;=',time.strftime('%Y-%m-01'))]</field>
        </record>
        <menuitem id="next_id_69" name="This Month" parent="hr.menu_hr_reporting"/><menuitem action="action_timesheet_user_stat" id="menu_report_timesheet_user" parent="next_id_69"/>
        
        <record id="view_timesheet_account_date_graph_account" model="ir.ui.view">
            <field name="name">report_timesheet.account.date.graph</field>
            <field name="model">report_timesheet.account.date</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph orientation="horizontal" string="Daily timesheet per account" type="bar">
                    <field name="name"/>
                    <field name="quantity" operator="+"/>
                    <field group="True" name="account_id"/>
                </graph>
            </field>
        </record>
        
        
        
        <record id="action_timesheet_user_stat_my" model="ir.actions.act_window">
            <field name="name">My Timesheet of the Month</field>
            <field name="res_model">report_timesheet.account.date</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="view_id" ref="view_timesheet_account_date_graph_account"/>
            <field name="domain">[('name','&gt;=',time.strftime('%Y-%m-01')), ('user_id','=',uid)]</field>
        </record>
        <menuitem action="action_timesheet_user_stat_my" id="menu_report_timesheet_user_my" parent="report_timesheet.next_id_69"/>
        
        
        <record id="action_timesheet_user_stat_all" model="ir.actions.act_window">
            <field name="name">Timesheet by User</field>
            <field name="res_model">report_timesheet.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
        </record>
        <menuitem id="next_id_70" name="All Months" parent="hr.menu_hr_reporting"/><menuitem action="action_timesheet_user_stat_all" id="menu_report_timesheet_user_all" parent="next_id_70"/>
        
        <!-- Statistics report on timesheets to invoice -->
        
        <record id="view_timesheet_invoice_graph" model="ir.ui.view">
            <field name="name">report_timesheet.invoice.graph</field>
            <field name="model">report_timesheet.invoice</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Timesheet by invoice">
                    <field name="account_id"/>
                    <field name="amount_invoice" operator="+"/>
                </graph>
            </field>
        </record>
        
        
        <record id="view_timesheet_invoice_form" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.invoice.form</field>
            <field name="model">report_timesheet.invoice</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Timesheet by invoice">
                    <field name="account_id" select="1"/>
                    <field name="manager_id" select="1"/>
                    <field name="user_id" select="1"/>
                </form>
            </field>
        </record>
        
        
        <record id="view_timesheet_invoice_tree" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.invoice.tree</field>
            <field name="model">report_timesheet.invoice</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Timesheets to invoice">
                    <field name="user_id"/>
                    <field name="account_id"/>
                    <field name="manager_id"/>
                    <field name="quantity"/>
                    <field name="amount_invoice"/>
                </tree>
            </field>
        </record>
        
        <record id="action_timesheet_invoice_stat_all" model="ir.actions.act_window">
            <field name="name">Timesheet by Invoice</field>
            <field name="res_model">report_timesheet.invoice</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
        </record>
        <menuitem action="action_timesheet_invoice_stat_all" id="menu_report_timesheet_invoice_all" parent="report_timesheet.next_id_70"/>
        
        <record id="action_timesheet_invoice_stat_my" model="ir.actions.act_window">
            <field name="name">My timesheets to invoice</field>
            <field name="res_model">report_timesheet.invoice</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="domain">[('manager_id','=',uid)]</field>
        </record>
        <menuitem action="action_timesheet_invoice_stat_my" id="menu_report_timesheet_invoice_my" parent="report_timesheet.next_id_69"/>
        
        <!-- Statistics report on daily timesheets per account -->
        
        <record id="view_timesheet_account_date_tree" model="ir.ui.view">
            <field name="name">report_timesheet.account.date.tree</field>
            <field name="model">report_timesheet.account.date</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Daily timesheet per account">
                    <field name="name"/>
                    <field name="account_id"/>
                    <field name="user_id"/>
                    <field name="quantity"/>
                </tree>
            </field>
        </record>
        <record id="view_timesheet_account_date_graph" model="ir.ui.view">
            <field name="name">report_timesheet.account.date.graph</field>
            <field name="model">report_timesheet.account.date</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph orientation="horizontal" string="Daily timesheet per account">
                    <field name="account_id"/>
                    <field name="quantity" operator="+"/>
                    <field group="True" name="user_id"/>
                </graph>
            </field>
        </record>
        
        
        <record id="view_timesheet_account_date_form" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.account.date.form</field>
            <field name="model">report_timesheet.account.date</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Daily timesheet by account">
                    <field name="name" select="1"/>
                    <field name="account_id" select="1"/>
                    <field name="user_id" select="1"/>
                    <field name="quantity"/>
                </form>
            </field>
        </record>
        
        <record id="action_timesheet_account_date_stat_all" model="ir.actions.act_window">
            <field name="name">Daily Timesheet by Account</field>
            <field name="res_model">report_timesheet.account.date</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
        </record>
        <menuitem action="action_timesheet_account_date_stat_all" id="menu_report_timesheet_account_date_all" parent="report_timesheet.next_id_70"/>
        
        <record id="action_timesheet_account_date_stat_my" model="ir.actions.act_window">
            <field name="name">My daily timesheets by account</field>
            <field name="res_model">report_timesheet.account.date</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="domain">[('user_id','=',uid)]</field>
        </record>
        <menuitem action="action_timesheet_account_date_stat_my" id="menu_report_timesheet_account_date_my" parent="report_timesheet.next_id_69"/>
        
        <!-- Statistics report on timesheets per account -->
        
        <record id="view_timesheet_account_tree" model="ir.ui.view">
            <field name="name">report_timesheet.account.tree</field>
            <field name="model">report_timesheet.account</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Timesheet per account">
                    <field name="name"/>
                    <field name="account_id"/>
                    <field name="user_id"/>
                    <field name="quantity"/>
                </tree>
            </field>
        </record>
        <record id="view_timesheet_account_graph" model="ir.ui.view">
            <field name="name">report_timesheet.account.graph</field>
            <field name="model">report_timesheet.account</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Timesheet per account">
                    <field name="account_id"/>
                    <field name="quantity" operator="+"/>
                    <field group="True" name="user_id"/>
                </graph>
            </field>
        </record>
        
        
        
        <record id="view_timesheet_account_form" model="ir.ui.view">
            <field name="name">report_timesheet.timesheet.account.form</field>
            <field name="model">report_timesheet.account</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Timesheet by account">
                    <field name="name" select="1"/>
                    <field name="account_id" select="1"/>
                    <field name="user_id" select="1"/>
                    <field name="quantity"/>
                </form>
            </field>
        </record>
        
        <record id="action_timesheet_account_stat_all" model="ir.actions.act_window">
            <field name="name">Timesheet by Account</field>
            <field name="res_model">report_timesheet.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
        </record>
        <menuitem action="action_timesheet_account_stat_all" id="menu_report_timesheet_account_all" parent="report_timesheet.next_id_70"/>
        
        <record id="action_timesheet_account_stat_my" model="ir.actions.act_window">
            <field name="name">My timesheets by account</field>
            <field name="res_model">report_timesheet.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="domain">[('user_id','=',uid)]</field>
        </record>
        <menuitem action="action_timesheet_account_stat_my" id="menu_report_timesheet_account_my" parent="report_timesheet.next_id_69"/>
        
        <act_window domain="[('user_id', '=', active_id)]" id="act_res_users_2_report_timesheet_user" name="Timesheets per day" res_model="report_timesheet.user" src_model="res.users"/>
        
        <act_window domain="[('user_id', '=', active_id)]" id="act_res_users_2_report_timehsheet_account" name="Timesheets per account" res_model="report_timesheet.account" src_model="res.users"/>
        
        <act_window domain="[('account_id', '=', active_id)]" id="act_account_analytic_account_2_report_timehsheet_account" name="Timesheets" res_model="report_timesheet.account" src_model="account.analytic.account"/>
        
        <act_window domain="[('manager_id', '=', active_id)]" id="act_res_users_2_report_timesheet.invoice" name="Costs to invoice" res_model="report_timesheet.invoice" src_model="res.users"/>
        
    </data>
</terp>