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

    <record id="cor_project_report_view_pivot" model="ir.ui.view">
        <field name="name">cor.project.report.pivot</field>
        <field name="model">cor.project.report</field>
        <field name="arch" type="xml">
            <pivot string="Budget Analysis" disable_linking="True" sample="1"> <!-- display_quantity="true" -->
                <field name="project_id" type="col"/>
                <!--<field name="hours_type" type="col"/>-->
                <field name="hours" type="measure"/>
            </pivot>
        </field>
    </record>

    <record id="cor_project_report_view_graph" model="ir.ui.view">
        <field name="name">cor.project.report.graph</field>
        <field name="model">cor.project.report</field>
        <field name="arch" type="xml">
            <graph string="COR Project Report" type="bar" stacked="False" sample="1" disable_linking="1">
                <field name="project_id" type="row"/>
                <!--<field name="hours_type" type="row"/>-->
                <field name="hours" type="measure"/>
             </graph>
         </field>
    </record>

    <record id="cor_project_report_view_tree" model="ir.ui.view">
        <field name="name">cor.project.report.tree</field>
        <field name="model">cor.project.report</field>
        <field name="arch" type="xml">
            <tree string="COR Project Report" create="false" edit="false" delete="false">
                <field name="project_id"/>
                <field name="employee_id"/>
                <field name="price_unit"/>
                <field name="budgeted_qty"/>
                <field name="cost"/>
                <field name="employee_price"/>
                <field name="hours"/>
                <field name="consultant_cost"/>
                <field name="actual_revenue"/>
                <field name="profit"/>
                <field name="profit_per"/>
             </tree>
         </field>
    </record>


    <record id="cor_project_report_view_search" model="ir.ui.view">
        <field name="name">cor.project.report.search</field>
        <field name="model">cor.project.report</field>
        <field name="arch" type="xml">
            <search string="Project Report">
                <field name="project_id"/>
                <field name="employee_id"/>
                <field name="hours"/>
                <group expand="1" string="Group By">
                    <filter string="Project" name="group_by_project" context="{'group_by':'project_id'}"/>
                    <filter string="Consultant" name="group_by_employee_id" context="{'group_by':'employee_id'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="cor_project_report_view_action" model="ir.actions.act_window">
        <field name="name">COR Project Report</field>
        <field name="res_model">cor.project.report</field>
        <field name="view_mode">tree,pivot,graph</field>
        <field name="search_view_id" ref="cor_project_report_view_search"/>
        <field name="context">{'search_default_group_by_project': 1, 'default_res_model': 'cor.project.report'}</field>
    </record>

    <menuitem id="menu_cor_project_report"
        parent="project.menu_project_report"
        action="cor_project_report_view_action"
        name="COR Project Report"
        sequence="50"/>

</odoo>
