<odoo>
    <record id="view_mcs_appointment_booking_tree" model="ir.ui.view">
        <field name="name">mcs.appointment.booking.tree</field>
        <field name="model">mcs.appointment.booking</field>
        <field name="arch" type="xml">
            <tree decoration-muted="state == 'cancelled'">
                <field name="start"/>
                <field name="appointment_type_id"/>
                <field name="customer_name"/>
                <field name="customer_email"/>
                <field name="user_id"/>
                <field name="state"/>
            </tree>
        </field>
    </record>

    <record id="view_mcs_appointment_booking_form" model="ir.ui.view">
        <field name="name">mcs.appointment.booking.form</field>
        <field name="model">mcs.appointment.booking</field>
        <field name="arch" type="xml">
            <form>
                <header>
                    <button name="action_confirm" type="object" string="Confirm" class="btn-primary" invisible="state == 'confirmed'"/>
                    <button name="action_cancel" type="object" string="Cancel" invisible="state == 'cancelled'"/>
                    <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,cancelled"/>
                </header>
                <sheet>
                    <group>
                        <group>
                            <field name="appointment_type_id"/>
                            <field name="user_id"/>
                            <field name="partner_id"/>
                            <field name="calendar_event_id"/>
                        </group>
                        <group>
                            <field name="start"/>
                            <field name="stop"/>
                            <field name="company_id" groups="base.group_multi_company"/>
                        </group>
                    </group>
                    <group string="Customer">
                        <field name="customer_name"/>
                        <field name="customer_email"/>
                        <field name="customer_phone"/>
                    </group>
                    <group string="Notes">
                        <field name="notes" nolabel="1"/>
                    </group>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids"/>
                    <field name="activity_ids"/>
                    <field name="message_ids"/>
                </div>
            </form>
        </field>
    </record>

    <record id="view_mcs_appointment_booking_calendar" model="ir.ui.view">
        <field name="name">mcs.appointment.booking.calendar</field>
        <field name="model">mcs.appointment.booking</field>
        <field name="arch" type="xml">
            <calendar date_start="start" date_stop="stop" color="appointment_type_id">
                <field name="customer_name"/>
                <field name="appointment_type_id"/>
            </calendar>
        </field>
    </record>

    <record id="action_mcs_appointment_booking" model="ir.actions.act_window">
        <field name="name">Bookings</field>
        <field name="res_model">mcs.appointment.booking</field>
        <field name="view_mode">tree,calendar,form</field>
    </record>
</odoo>
