[WIP] Added Room Type and Rooms

Master Node keeps minimal information of Hotel rooms for managing reservation through the reservation wizard.
This commit is contained in:
Pablo Quesada Barriuso
2018-09-21 13:53:19 +02:00
parent a5ad202432
commit c777ee97e9
9 changed files with 170 additions and 17 deletions

View File

@@ -48,12 +48,18 @@
<page name="groups" string="Groups" attrs="{'invisible':[('id','=',False)]}">
<group>
<field name="odoo_version" readonly="1"/>
<!-- TODO Make group_ids readonly in hotel node form -->
<field name="group_ids" domain="[('odoo_version','=',odoo_version)]"/>
</group>
</page>
<page name="users" string="Users" attrs="{'invisible':[('id','=',False)]}">
<group>
<field name="user_ids" context="{'default_node_id': id}" />
<field name="user_ids" context="{'default_node_id': active_id}" />
</group>
</page>
<page name="room_type" string="Room Type" attrs="{'invisible':[('id','=',False)]}">
<group>
<field name="room_type_ids" context="{'default_node_id': active_id}" />
</group>
</page>
<page name="settings" string="Settings">
@@ -104,6 +110,12 @@
res_model="project.project"
view_mode="tree,form"
/>
<!-- Action to open Hotel Room Types List -->
<act_window id="hotel_node_room_type_action"
name="List of Room Types in Hotels"
res_model="hotel.node.room.type"
view_mode="tree,form"
/>
<!-- Action to open Hotel Users List -->
<act_window id="hotel_node_user_action"
name="List of Users in Hotels"
@@ -134,6 +146,13 @@
parent="dashboard_menu"
sequence="1"
/>
<!-- Menu item to open Hotel Nodes List -->
<menuitem id="hotel_node_room_type_menu"
name="Room Types"
action="hotel_node_room_type_action"
parent="hotel_node_menu"
sequence="1"
/>
<!-- Menu item to open Hotel Users List -->
<menuitem id="hotel_node_user_menu"
name="Users"

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hotel_node_room_type_view_form" model="ir.ui.view">
<field name="name">hotel.node.room.type.view.form</field>
<field name="model">hotel.node.room.type</field>
<field name="arch" type="xml">
<form string="Hotel Room Type">
<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">
<h1>
<field name="node_id" placeholder="Hotel" required="1"
attrs="{'readonly': [('node_id', '!=', False)]}"/>
</h1>
</div>
<group name="room_type" attrs="{'invisible':[('node_id','=',False)]}">
<group>
<field name="name" placeholder="Room Type Name" required="1"/>
</group>
<group>
<div name="options_active">
<label for="remote_room_type_id" class="oe_inline" string="Remote Room Type :"/>
<field name="remote_room_type_id" readonly="1" attrs="{'invisible': [('id', '=', False)]}" />
</div>
</group>
</group>
<notebook>
<page name="Rooms" string="Rooms" attrs="{'invisible':[('id','=',False)]}">
<group>
<field name="room_ids" widget="many2many" domain="[('room_type_id','=',active_id)]"
context="{'default_node_id': node_id, 'default_room_type_id': active_id}"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="hotel_node_room_type_view_tree" model="ir.ui.view">
<field name="name">hotel.node.room.type.tree</field>
<field name="model">hotel.node.room.type</field>
<field name="arch" type="xml">
<tree>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="node_id"/>
</tree>
</field>
</record>
</odoo>

View File

@@ -14,23 +14,25 @@
</button>
</div>
<div class="oe_title">
<label for="partner_id" string="Central user" class="oe_edit_only"/>
<h1>
<field name="partner_id" required="1"/>
<field name="node_id" placeholder="Hotel" required="1"
attrs="{'readonly': [('node_id', '!=', False)]}"/>
</h1>
</div>
<group attrs="{'invisible': [('node_id', '=', False)]}">
<group name="nodes">
<field name="partner_id" placeholder="Name" required="1"/>
<field name="remote_user_id" readonly="1" attrs="{'invisible': [('id', '=', False)]}" />
</group>
</group>
<group attrs="{'invisible': [('partner_id', '=', False)]}">
<group name="login">
<field name="login"/>
<field name="password" password="True"/>
</group>
<group name="nodes">
<field name="node_id"/>
<field name="remote_user_id" readonly="1" attrs="{'invisible': [('id', '=', False)]}" />
</group>
</group>
<group name="groups" attrs="{'invisible': [('node_id', '=', False)]}">
<field name="group_ids"/>
<group name="groups" attrs="{'invisible': [('node_id', '=', False)]}" collapse="2">
<field name="group_ids"/>
</group>
</sheet>
</form>
@@ -46,7 +48,6 @@
<field name="partner_id"/>
<field name="login"/>
<field name="node_id"/>
<field name="remote_user_id"/>
</tree>
</field>
</record>