<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Tree View -->
    <record id="view_restaurant_floor_tree" model="ir.ui.view">
        <field name="name">restaurant.floor.tree.dine360</field>
        <field name="model">restaurant.floor</field>
        <field name="arch" type="xml">
            <tree string="Restaurant Floors">
                <field name="sequence" widget="handle"/>
                <field name="name"/>
                <field name="pos_config_ids" widget="many2many_tags"/>
            </tree>
        </field>
    </record>

    <!-- Form View -->
    <record id="view_restaurant_floor_form" model="ir.ui.view">
        <field name="name">restaurant.floor.form.dine360</field>
        <field name="model">restaurant.floor</field>
        <field name="arch" type="xml">
            <form string="Restaurant Floor">
                <sheet>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" placeholder="e.g. Ground Floor, Garden, VIP..."/>
                        </h1>
                    </div>
                    <group>
                        <group string="Configurations">
                            <field name="pos_config_ids" widget="many2many_tags" placeholder="Link to Point of Sale Configs..."/>
                            <field name="background_color" widget="color" placeholder="e.g. rgb(220, 220, 220)"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Tables on Floor" name="tables">
                            <field name="table_ids" context="{'default_floor_id': active_id}">
                                <tree string="Tables" editable="bottom">
                                    <field name="name"/>
                                    <field name="seats"/>
                                    <field name="shape"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Floor Window Action -->
    <record id="action_restaurant_floor_form" model="ir.actions.act_window">
        <field name="name">Floors</field>
        <field name="res_model">restaurant.floor</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_restaurant_floor_tree"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create a new floor plan!
            </p>
            <p>
                Floors represent different physical sections of your restaurant (e.g., Main Hall, Terrace, Bar).
            </p>
        </field>
    </record>
</odoo>
