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

    <record id="view_evaluation_report_tree" model="ir.ui.view">
        <field name="name">hr.evaluation.report.tree</field>
        <field name="model">hr.evaluation.report</field>
        <field name="arch" type="xml">
            <tree colors="blue:state == 'draft';black:state in ('wait','progress');gray:state in('done','cancel')" create="false"
             string="Appraisal Analysis">
                <field name="create_date" invisible="1"/>
                <field name="employee_id" invisible="1"/>
                <field name="deadline" invisible="1"/>
                <field name="closed" invisible="1"/>
                <field name="day" invisible="1"/>
                <field name="plan_id" invisible="1"/>
                <field name="year" invisible="1"/>
                <field name="month" invisible="1"/>
                <field name="rating" invisible="1"/>
                <field name="state" invisible="1"/>
                <field name="nbr" sum="# of Requests"/>
                <field name="delay_date"/>
                <field name="overpass_delay"/>
            </tree>
        </field>
    </record>

    <record id="view_evaluation_report_graph" model="ir.ui.view">
            <field name="name">hr.evaluation.report.graph</field>
            <field name="model">hr.evaluation.report</field>
            <field name="arch" type="xml">
            <graph string="Appraisal Analysis" type="bar">
                 <field name="employee_id"/>
                 <field name="nbr" operator="+"/>
                 <field name="state" group="True"/>
             </graph>
         </field>
    </record>

    <record id="view_evaluation_report_search" model="ir.ui.view">
        <field name="name">hr.evaluation.report.search</field>
        <field name="model">hr.evaluation.report</field>
        <field name="arch" type="xml">
            <search string="Appraisal Analysis">
                <filter string="In Progress" icon="terp-camera_test" domain="[('state', '=' ,'wait')]" help = "In progress Evaluations"/>
                <filter string="Final Validation" icon="terp-camera_test" domain="[('state','=','progress')]" help = "Final Validation Evaluations"/>
                <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/>
                <field name="employee_id"/>
                <field name="plan_id"/>
                <group expand="0" string="Extended Filters...">
                    <field name="rating"/>
                    <field name="deadline"/>
                    <field name="state"/>
                    <field name="create_date"/>
                </group>
                <group expand="1" string="Group By...">
                    <filter string="Employee" name="employee" icon="terp-personal" context="{'group_by':'employee_id'}"/>
                    <filter string="Plan" icon="terp-stock_align_left_24" context="{'group_by':'plan_id'}"/>
                    <filter string="Appreciation" icon="terp-face-plain" context="{'group_by':'rating'}"/>
                    <filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
                    <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
                    <filter string="Month" icon="terp-go-month" context="{'group_by':'create_date'}" help="Creation Date"/>
                    <filter string="Year" icon="terp-go-month" context="{'group_by':'year'}" help="Creation Date"/>
                </group>
            </search>
        </field>
    </record>

    <record id="action_evaluation_report_all" model="ir.actions.act_window">
        <field name="name">Appraisal Analysis</field>
        <field name="res_model">hr.evaluation.report</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_employee':1,'group_by_no_leaf':1,'group_by':[]}</field>
        <field name="search_view_id" ref="view_evaluation_report_search"/>
    </record>

    <menuitem action="action_evaluation_report_all" id="menu_evaluation_report_all" parent="hr.menu_hr_reporting" sequence="2" groups="base.group_hr_manager"/>

    </data>
</openerp>
