<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_reservation_schedule_tree" model="ir.ui.view">
        <field name="name">reservation.schedule.tree</field>
        <field name="model">reservation.schedule</field>
        <field name="arch" type="xml">
            <tree editable="bottom">
                <field name="day"/>
                <field name="is_closed"/>
                <field name="opening_time" widget="float_time" invisible="is_closed"/>
                <field name="closing_time" widget="float_time" invisible="is_closed"/>
                <field name="has_break" invisible="is_closed"/>
                <field name="break_start_time" widget="float_time" invisible="not has_break or is_closed"/>
                <field name="break_end_time" widget="float_time" invisible="not has_break or is_closed"/>
            </tree>
        </field>
    </record>

    <record id="view_reservation_schedule_form" model="ir.ui.view">
        <field name="name">reservation.schedule.form</field>
        <field name="model">reservation.schedule</field>
        <field name="arch" type="xml">
            <form string="Reservation Schedule">
                <sheet>
                    <group>
                        <field name="day"/>
                        <field name="is_closed"/>
                        <field name="default_slot_duration"/>
                    </group>
                    <group invisible="is_closed">
                        <group name="hours" string="Operating Hours">
                            <field name="opening_time" widget="float_time"/>
                            <field name="closing_time" widget="float_time"/>
                        </group>
                        <group name="break" string="Break Time">
                            <field name="has_break"/>
                            <field name="break_start_time" widget="float_time" invisible="not has_break"/>
                            <field name="break_end_time" widget="float_time" invisible="not has_break"/>
                        </group>
                    </group>
                    <notebook invisible="is_closed">
                        <page string="Peak Hour Slot Overrides" name="peak_hours">
                            <field name="peak_hour_ids">
                                <tree editable="bottom">
                                    <field name="start_time" widget="float_time"/>
                                    <field name="end_time" widget="float_time"/>
                                    <field name="slot_duration"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_reservation_schedule" model="ir.actions.act_window">
        <field name="name">Reservation Schedule</field>
        <field name="res_model">reservation.schedule</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Manage your daily reservation hours and break times.
            </p>
        </field>
    </record>
</odoo>
