<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="resource_calendar_form_cust" model="ir.ui.view">
            <field name="name">resource.calendar.form.cust</field>
            <field name="model">resource.calendar</field>
            <field name="inherit_id" ref="resource.resource_calendar_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='global_leave_ids']//field[@name='date_to']" position="after">
                    <field name="company_res_calendar_leaves_id" invisible="1"/>
                </xpath>
            </field>
        </record>
        <record id="view_company_resource_calendar_search" model="ir.ui.view">
            <field name="name">company.resource.calendar.search</field>
            <field name="model">company.resource.calendar</field>
            <field name="arch" type="xml">
                <search string="Company Public Holiday">
                    <field name="name" string="Resource"/>
                    <field name="company_id"/>
                </search>
            </field>
        </record>
        <record id="view_company_resource_calendar_form" model="ir.ui.view">
            <field name="name">company.resource.calendar.form</field>
            <field name="model">company.resource.calendar</field>
            <field name="arch" type="xml">
                <form string="Company Public Holiday">
                    <header>
                        <button name="action_public_holiday_send" string="Send by Email" type="object" class="btn-primary"/>
                        <!--<button name="action_holiday_update_calendar" string="Update Holiday Calendar" type="object" class="btn-primary"/>-->
                        <button name="action_holiday_update_timeoff_calendar" string="Update Holiday Calendar" type="object" class="btn-primary"/>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name="name"/>
                                <field name="year_list"/>
                            </group>
                            <group>
                                <field name="company_id" options="{'no_create': True}"/>
                            </group>
                        </group>
                        <notebook>
                            <page name="company_resource_calendar" string="Resouce Calendar Holiday">
                                <field name="company_global_leave_ids">
                                    <tree editable="bottom">
                                        <field name="name"/>
                                        <field name="date_from"/>
                                        <field name="date_to"/>
                                        <field name="company_id" invisible="1"/>
                                    </tree>
                                </field>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>
        <record id="view_company_resource_calendar_tree" model="ir.ui.view">
            <field name="name">company.resource.calendar.tree</field>
            <field name="model">company.resource.calendar</field>
            <field name="arch" type="xml">
                <tree string="Company Public Holiday">
                    <field name="name"/>
                    <field name="company_id"/>
                </tree>
            </field>
        </record>
        <record id="action_view_company_resource_calendar" model="ir.actions.act_window">
            <field name="name">Company Public Holiday</field>
            <field name="res_model">company.resource.calendar</field>
            <field name="view_mode">tree,form</field>
        </record>
        <!-- MENU ITEMS -->
        <menuitem id="menu_comp_resource_config" name="Company Public Holiday" parent="hr_holidays.menu_hr_holidays_root" sequence="7"/>
        <menuitem id="menu_comp_resource" parent="menu_comp_resource_config" action="action_view_company_resource_calendar" sequence="1"/>

    </data>
</odoo>