mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] Hotel Room Closure Reasons
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
'views/hotel_room_type_restriction_views.xml',
|
||||
'views/hotel_room_type_restriction_item_views.xml',
|
||||
'views/hotel_reservation.xml',
|
||||
'views/room_closure_reason.xml',
|
||||
# 'views/room_type_views.xml',
|
||||
'views/cardex.xml',
|
||||
'views/hotel_room_type_availability.xml',
|
||||
|
||||
@@ -31,4 +31,5 @@ from . import res_config
|
||||
from . import inherit_res_partner
|
||||
from . import inherited_mail_compose_message
|
||||
from . import hotel_room_type_class
|
||||
from . import room_closure_reason
|
||||
#~ from . import hotel_dashboard
|
||||
|
||||
@@ -48,6 +48,7 @@ class HotelFolio(models.Model):
|
||||
default=lambda self: _('New'))
|
||||
partner_id = fields.Many2one('res.partner',
|
||||
track_visibility='onchange')
|
||||
closure_reason_id = fields.Many2one('room.closure.reason')
|
||||
# partner_invoice_id = fields.Many2one('res.partner',
|
||||
# string='Invoice Address',
|
||||
# readonly=True, required=True,
|
||||
|
||||
@@ -159,6 +159,7 @@ class HotelReservation(models.Model):
|
||||
required=True, track_visibility='onchange')
|
||||
|
||||
partner_id = fields.Many2one(related='folio_id.partner_id')
|
||||
closure_reason_id = fields.Many2one(related='folio_id.closure_reason_id')
|
||||
company_id = fields.Many2one('res.company', 'Company')
|
||||
reservation_line_ids = fields.One2many('hotel.reservation.line',
|
||||
'reservation_id',
|
||||
|
||||
11
hotel/models/room_closure_reason.py
Normal file
11
hotel/models/room_closure_reason.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Copyright 2017 Dario Lodeiros
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from openerp import models, fields, api, _
|
||||
|
||||
|
||||
class RoomClosureReason(models.Model):
|
||||
_name = "room.closure.reason"
|
||||
_description = "Cause of out of service"
|
||||
|
||||
name = fields.Char('Name', required=True)
|
||||
description = fields.Text('Description')
|
||||
@@ -124,7 +124,8 @@
|
||||
<!-- <field name="image" widget="image" class="oe_avatar" options="{"preview_image": "image_medium", "size": [90, 90]}"/> -->
|
||||
<h2><field name="name"/></h2>
|
||||
<h1>
|
||||
<field name="partner_id" default_focus="1" placeholder="Guest"/>
|
||||
<field name="partner_id" default_focus="1" placeholder="Guest" attrs="{'invisible':[('reservation_type','in',('out'))]}"/>
|
||||
<field name="closure_reason_id" placeholder="Closure reason" default_focus="1" attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
|
||||
@@ -161,9 +161,19 @@
|
||||
style="margin-right: 30px;" required='1'/>
|
||||
<field name="partner_id" default_focus="1"
|
||||
placeholder="Lastname, Firstname"
|
||||
attrs="{'readonly':[('folio_id','!=',False)]}"
|
||||
attrs="{'readonly':[('folio_id','!=',False)],
|
||||
'invisible':[('reservation_type','in',('out'))]}"
|
||||
required="1"/>
|
||||
<span class="fa fa-user" style="margin-left:20px;"/>
|
||||
<field name="closure_reason_id" default_focus="1"
|
||||
options="{'no_create': True,'no_open': True}"
|
||||
placeholder="Closure Reason"
|
||||
attrs="{'readonly':[('folio_id','!=',False)],
|
||||
'invisible':[('reservation_type','not in',('out'))]}"
|
||||
required="1"/>
|
||||
<span class="fa fa-user" style="margin-left:20px;"
|
||||
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||
<span class="fa fa-ban" style="margin-left:20px;"
|
||||
attrs="{'invisible': [('reservation_type','not in',('out'))]}"/>
|
||||
</h1>
|
||||
<h3>
|
||||
From <span class="fa fa-sign-in" style="margin: 5px;"/>
|
||||
|
||||
41
hotel/views/room_closure_reason.xml
Normal file
41
hotel/views/room_closure_reason.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Form view of hotel room type class-->
|
||||
<record model="ir.ui.view" id="view_hotel_room_closure_reason_form">
|
||||
<field name="name">hotel.room.closure.reason.form</field>
|
||||
<field name="model">room.closure.reason</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Hotel Room Closure Reason">
|
||||
<sheet>
|
||||
<field name="name" />
|
||||
<field name="description" />
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Tree view of hotel room type class -->
|
||||
<record model="ir.ui.view" id="view_hotel_room_closure_reason_tree">
|
||||
<field name="name">>hotel.room.closure.reason.tree</field>
|
||||
<field name="model">room.closure.reason</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Hotel Room Closure Reason">
|
||||
<field name="name"/>
|
||||
<field name="description" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for hotel room type class -->
|
||||
<record model="ir.actions.act_window" id="open_hotel_room_closure_reason_form_tree">
|
||||
<field name="name">Room Closure Reason</field>
|
||||
<field name="res_model">room.closure.reason</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="Closure Reasons" id="menu_hotel_room_closure_reason_form_tree"
|
||||
action="open_hotel_room_closure_reason_form_tree" sequence="25"
|
||||
parent="hotel.configuration_others" />
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user