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

    <!-- =================================================== Rooms =================================================== -->
    <!-- Form view of hotel room -->
    <record model="ir.ui.view" id="view_hotel_room_form">
      <field name="name">hotel.room.form</field>
      <field name="model">hotel.room</field>
      <field name="arch" type="xml">
        <form string="Hotel Room">
          <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>
              <!-- <label for="to_be_cleaned" string="To be Cleaned" />
              <h2>
                <field name="to_be_cleaned"/>
              </h2> -->
            </div>
            <notebook>
              <page name="information_hotel_room" string="Information">
                <group colspan="4" col="4">
                  <field name="floor_id" string="Ubication" />
                  <!-- <field name="categ_id" select="1" domain="[('isroomtype','=',True)]" string="Room Type" /> -->
                  <field name="room_type_id" string="Room Type" />
                  <field name="capacity" />
                  <field name="shared_room" help="It allows several reservations on the same room simultaneously based on the capacity of people"/>
                  <!-- <field name="uom_id" invisible="1" /> -->
                </group>
                <group>
              		<!-- <field name="sale_price_type" /> -->
              		<!--field name="price_virtual_room_domain" invisible="1" /-->
          			  <!-- <field name="price_virtual_room" domain="[('room_ids.id', '=', active_id)]" attrs="{'invisible':[('sale_price_type', '!=', 'vroom')], 'required': [('sale_price_type', '=', 'vroom')]}" /> -->
                  <!-- <field name="price_room_type" domain="[('room_ids.id', '=', active_id)]" attrs="{'invisible':[('sale_price_type', '!=', 'vroom')], 'required': [('sale_price_type', '=', 'vroom')]}" /> -->
                  <field name="list_price" />
                </group>
                <newline />
                <!-- <separator colspan='4' string="Customer Taxes" /> -->
                <!-- <field name="taxes_id" colspan="4" nolabel='1'
                                help='Customer taxes apply on the perticular room. ' /> -->
              </page>
              <page string="Room Amenities">
                <separator string=" Room Amenities" />
                <field name="room_amenities" colspan="4" nolabel="1" />
              </page>
              <page string="Descriptions">
                <group>
                    <field name="description_sale" colspan="2" string="Name in reports"/>
                    <!-- <field name="description" colspan="2" string="Description Sales"/> -->
                </group>
              </page>
            </notebook>
            <group>
              <field name="sequence" />
            </group>
          </sheet>
        </form>
      </field>
    </record>

    <!-- Search view of hotel room -->
    <record model="ir.ui.view" id="view_hotel_room_search">
        <field name="name">hotel.room.search</field>
        <field name="model">hotel.room</field>
        <field name="arch" type="xml">
            <search string="Hotel Room">
                <field name="name" />
                <field name="room_type_id" />
                <field name="list_price" string="Room rate" />
                <field name="capacity" />
                <newline />
                <!--<filter name="available" string="Available"
                    domain="[('status','=', 'available')]" help="Available Rooms" />-->
                <!--<filter string="Reserved" domain="[('status','=', 'occupied')]"
                    help="Reserved Rooms" />-->
            </search>
        </field>
    </record>

    <!-- Tree view of hotel room -->
    <record model="ir.ui.view" id="view_hotel_room_tree">
        <field name="name">hotel.room.tree</field>
        <field name="model">hotel.room</field>
        <field name="arch" type="xml">
            <tree string="Hotel Room">
                <field name="sequence" widget="handle"/>
                <field name="name" />
                <field name="room_type_id" />
                <field name="list_price" string="Room rate" />
                <field name="capacity" />
            </tree>
        </field>
    </record>

    <!-- <record model="ir.ui.view" id="view_hotel_room_kanban">
        <field name="name">hotel.room.kanban</field>
        <field name="model">hotel.room</field>
        <field name="arch" type="xml">
            <kanban>
                <field name="name" />
                <field name="lst_price" />
                <templates>
                    <t t-name="kanban-box">
                        <div
                            t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">

                            <div class="o_dropdown_kanban dropdown" groups="base.group_user">
                                <a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
                                    <span class="fa fa-bars fa-lg" />
                                </a>
                                <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                                    <t t-if="widget.editable">
                                        <li>
                                            <a type="edit">Edit</a>
                                        </li>
                                    </t>
                                    <t t-if="widget.deletable">
                                        <li>
                                            <a type="delete">Delete</a>
                                        </li>
                                    </t>
                                    <li>
                                        <ul class="oe_kanban_colorpicker" data-field="color" />
                                    </li>
                                </ul>
                            </div>
                            <div class="oe_kanban_details" style='margin-top: -5px;'>
                                <div class="oe_kanban_content">
                                    <div class="oe_kanban_project_list">
                                        <H3>
                                            <a type="open">
                                                <t t-if="record.code.raw_value" style="margin-right: 10px">
                                                    [
                                                    <field name="code" />
                                                    ]
                                                </t>
                                                <field name="name" />
                                            </a>
                                        </H3>
                                    </div>
                                    <div name="tags" />
                                    <ul>
                                        <li>
                                            Rate:
                                            <field name="lst_price"></field>
                                        </li>
                                        <li>
                                            Capacity:
                                            <field name="capacity"></field>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="oe_clear"></div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record> -->


    <!-- Action for hotel room -->
    <record model="ir.actions.act_window" id="action_hotel_room_form">
        <field name="name">Hotel Room</field>
        <field name="res_model">hotel.room</field>
        <field name="view_type">form</field>
        <!-- <field name="context">{'default_isroom':1,'default_rental':1}
        </field> -->
        <field name="view_id" ref="view_hotel_room_tree" />
        <field name="view_mode">kanban,tree,form</field>
    </record>

    <menuitem name="Rooms" id="menu_open_hotel_room_form" action="action_hotel_room_form"
        sequence="5" parent="hotel.menu_hotel_room" />

    <!-- Room Categories -->

    <!-- <record id="product_category_tree_view" model="ir.ui.view">
        <field name="name">product.category.tree</field>
        <field name="model">product.category</field>
        <field name="field_parent">child_id</field>
        <field name="arch" type="xml">
            <tree toolbar="True" string="Product Categories">
                <field name="name" />
            </tree>
        </field>
    </record> -->

    <!-- <record model="ir.actions.act_window" id="hotel_room_category_action">
        <field name="name">Rooms by Category</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.category</field>
        <field name="domain">[('parent_id','=',False),('isroomtype','=',True)]</field>
        <field name="view_type">tree</field>
        <field name="view_id" ref="product_category_tree_view" />
    </record> -->

    <!-- <record id="action_room_cate" model="ir.actions.act_window">
        <field name="name">Category Items</field>
        <field name="res_model">product.product</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">['|','|',('isroom','=',True), ('iscategid' , '=', True), ('isservice', '=', True)]</field>
        <field name="context">{'search_default_categ_id':active_id, 'default_categ_id':active_id}</field>
    </record> -->

    <!--record id="ir_room_category_open" model="ir.default">
        <field eval="'tree_but_open'" name="key2"/>
        <field eval="'product.category'" name="model"/>
        <field name="name">Rooms</field>
        <field eval="'ir.actions.act_window,%d'%action_room_cate" name="value"/>
    </record-->

    <!-- <menuitem name="Room by Type" id="menu_hotel_room_category_action"
        action="hotel_room_category_action" sequence="7" parent="hotel.menu_hotel_room" /> -->

</odoo>
