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

    <record id="view_project_consultant_hrs_form" model="ir.ui.view">
            <field name="name">project.consultant.hrs.form</field>
            <field name="model">project.consultant.hrs</field>
            <field name="arch" type="xml">
                <form string="Consultant Allocation" create="false" edit="false" delete="false">
                    <group>
                     <field name="project_id"/>
                     <field name="employee_id"/>
                     <field name="start_date"/>
                     <field name="end_date"/>
                     <field name="percentage"/>
                     <field name="budgeted_hours"/>
                     <field name="actual_percentage"/>
                     <field name="actual_hours"/>
                    </group>
                </form>
            </field>
    </record>

    <record id="view_project_consultant_hrs_tree" model="ir.ui.view">
            <field name="name">project.consultant.hrs.tree</field>
            <field name="model">project.consultant.hrs</field>
            <field name="arch" type="xml">
                <tree string="Consultant Allocation" create="false" edit="false" delete="false">
                    <field name="project_id"/>
                    <field name="employee_id"/>
                    <field name="start_date"/>
                    <field name="end_date"/>
                    <field name="percentage"/>
                    <field name="budgeted_hours"/>
                    <field name="actual_percentage"/>
                    <field name="actual_hours"/>
                </tree>
            </field>
        </record>

     <record id="view_project_consultant_hrs_search" model="ir.ui.view">
            <field name="name">project.consultant.hrs.search</field>
            <field name="model">project.consultant.hrs</field>
            <field name="arch" type="xml">
                <search string="Consultant Allocation">
                    <field name="project_id"/>
                    <field name="employee_id"/>
                    <group expand="0" string="Group By">
                        <filter string="Project" name="project"  domain="[]" context="{'group_by':'project_id'}"/>
                        <filter string="Consultant" name="consultant" domain="[]" context="{'group_by':'employee_id'}"/>
                        <filter string="Start Date" name="sdate" domain="[]" context="{'group_by':'start_date'}"/>
                        <filter string="End Date" name="edate" domain="[]" context="{'group_by':'end_date'}"/>
                    </group>
                </search>
            </field>
     </record>

      <record id="action_project_consultant_hrs" model="ir.actions.act_window">
            <field name="name">Consultant Allocation</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">project.consultant.hrs</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="view_project_consultant_hrs_search"/>
            <field name="context">{
                'search_default_project': 1,
                'search_default_consultant': 1,
                }
            </field>
        </record>

    <!--<record id="project_consul_hours_view_form" model="ir.ui.view">
        <field name="name">Project Consul Hours</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button class="oe_stat_button" type="action" name="cor_custom.action_project_consultant_hrs" icon="fa-tasks"
                       attrs="{'invisible':['|',('pricing_type','!=','employee_rate'),('project_type','!=','hours_in_consultant')]}" string="View Allocation" widget="statinfo">
                </button>
            </div>
        </field>
    </record>-->

</odoo>
