<?xml version="1.0"?>
<odoo>

  <!-- FORM restriction -->
  <record id="room_type_restriction_view_form" model="ir.ui.view">
    <field name="name">hotel.room.type.restriction.form</field>
    <field name="model">hotel.room.type.restriction</field>
    <field name="arch" type="xml">
      <form string="Restrictions">
        <sheet>
          <div class="oe_button_box" name="button_box">
            <button name="toggle_active" type="object"
                    class="oe_stat_button" icon="fa-archive">
              <field name="active" widget="boolean_button"
                     options='{"terminology": "archive"}'/>
            </button>
          </div>
          <div class="oe_title">
            <label for="name" string="Name" />
            <h1>
              <field name="name" />
            </h1>
          </div>
          <div>
            <field name="hotel_id" options="{'no_create': True,'no_open': True}"/>
            <separator string="Restriction Items"/>
            <field name="item_ids" nolabel="1">
              <tree string="Restriction Items">
                <field name="room_type_id"/>
                <field name="date"/>
                <field name="min_stay"/>
                <field name="closed"/>
              </tree>
            </field>
          </div>
        </sheet>
      </form>
    </field>
  </record>

  <!-- TREE restriction -->
  <record id="room_type_restriction_view_tree" model="ir.ui.view">
    <field name="name">hotel.room.type.restriction.tree</field>
    <field name="model">hotel.room.type.restriction</field>
    <field name="arch" type="xml">
      <tree string="Restrictions">
        <field name="name"/>
        <field name="active"/>
      </tree>
    </field>
  </record>

  <!-- Action of reservation restriction -->
  <record model="ir.actions.act_window" id="room_type_restriction_action">
    <field name="name">Reservation restrictions</field>
    <field name="res_model">hotel.room.type.restriction</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
  </record>

  <!-- MENUS -->
  <menuitem name="Restrictions" id="reservation_restriction_menu"
    action="room_type_restriction_action" sequence="22"
    parent="hotel.configuration_others"/>

 </odoo>
