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

    <record id="channel_hotel_room_type_view_form" model="ir.ui.view">
        <field name="name">channel.hotel.room.type.form</field>
        <field name="model">channel.hotel.room.type</field>
        <field name="arch" type="xml">
            <form string="Hotel Channel Room Type">
                <group>
                    <field name="id" invisible="1" />
                    <field name="backend_id"  attrs="{'visible': [('id','=', False)], 'readonly': [('id','!=', False)]}" />
                </group>
                <group>
                    <field name="name"/>
                </group>
                <group>
                    <group>
                        <field name="external_id" />
                        <field name="channel_short_code" />
                    </group>
                    <group>
                        <field name="capacity" />
                        <field name="ota_capacity" />
                    </group>
                </group>
                <group>
                    <group>
                        <field name="list_price" class="oe_inline"/>
                        <field name="min_price" class="oe_inline"/>
                        <field name="max_price" class="oe_inline"/>
                    </group>
                    <group>
                        <group>
                            <field name="default_quota"/>
                            <field name="default_max_avail"/>
                        </group>
                        <group>
                            <field name="total_rooms_count" />
                            <field name="default_availability" force_save="1" />
                        </group>
                        <label colspan="2" class="fa fa-info-circle"
                               string=" Use `-1` for managing no Quota or Maximum simultaneous availability.">
                        </label>
                    </group>
                </group>
                <group>
                    <field name="sync_date" readonly="1"/>
                </group>
            </form>
        </field>
    </record>

    <record id="channel_hotel_room_type_view_tree" model="ir.ui.view">
        <field name="name">channel.hotel.room.type.tree</field>
        <field name="model">channel.hotel.room.type</field>
        <field name="arch" type="xml">
            <tree string="Hotel Channel Room Type">
                <field name="backend_id"/>
            </tree>
        </field>
    </record>

    <record id="channel_hotel_room_type_action" model="ir.actions.act_window">
        <field name="name">Hotel Channel Connector Bindings</field>
        <field name="res_model">channel.hotel.room.type</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="view_type">form</field>
        <field name="domain">[]</field>
    </record>
</odoo>
