[WIP] Wizard Node Reservation

This commit is contained in:
Pablo Quesada Barriuso
2018-09-28 09:09:20 +02:00
parent bf8741e191
commit 9bc69da56a
8 changed files with 80 additions and 18 deletions

View File

@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import wizard_hotel_node_reservation

View File

@@ -0,0 +1,22 @@
# Copyright 2018 Pablo Q. Barriuso
# Copyright 2018 Alexandre Díaz
# Copyright 2018 Dario Lodeiros
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import models, fields, api, _
_logger = logging.getLogger(__name__)
class HotelNodeReservationWizard(models.TransientModel):
_name = "hotel.node.reservation.wizard"
_description = "Hotel Node Reservation Wizard"
node_id = fields.Many2one('project.project', 'Hotel')
room_type_id = fields.Many2one('hotel.node.room.type', 'Rooms Type')
room_type_name = fields.Char('Name', related='room_type_id.name')
room_id = fields.Many2one('hotel.node.room', 'Rooms')

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hotel_node_reservation_wizard_view_form" model="ir.ui.view">
<field name="name">hotel.node.reservation.wizard</field>
<field name="model">hotel.node.reservation.wizard</field>
<field name="arch" type="xml">
<form string="Users">
<sheet>
<div class="oe_title">
<h1>
<field name="node_id" placeholder="Hotel" required="1"
attrs="{'readonly': [('node_id', '!=', False)]}"/>
</h1>
</div>
<group attrs="{'invisible': [('node_id', '=', False)]}">
<group name="room_type">
<field name="room_type_id">
<tree>
<field name="name" string="Room Type" readonly="1"/>
<field name="remote_room_type_id" readonly="1"/>
</tree>
</field>
</group>
</group>
<footer attrs="{'invisible': [('node_id', '=', False)]}">
<button name="create_folio" string="Create Reservations" type="object"
class="oe_highlight" />
</footer>
</sheet>
</form>
</field>
</record>
</odoo>