mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[UPD] daily restriction plan for room types
This commit is contained in:
@@ -4,12 +4,22 @@ from odoo import models, fields, api
|
||||
|
||||
|
||||
class HotelRoomTypeRestriction(models.Model):
|
||||
""" The hotel room type restriction is used as a daily restriction plan for room types
|
||||
and therefore is related only with one hotel. """
|
||||
_name = 'hotel.room.type.restriction'
|
||||
|
||||
# Default methods
|
||||
@api.model
|
||||
def _get_default_hotel(self):
|
||||
return self.env.user.hotel_id
|
||||
|
||||
# Fields declaration
|
||||
name = fields.Char('Restriction Plan Name', required=True)
|
||||
hotel_id = fields.Many2one('hotel.property', 'Hotel', required=True, ondelete='restrict',
|
||||
default=_get_default_hotel)
|
||||
item_ids = fields.One2many('hotel.room.type.restriction.item',
|
||||
'restriction_id', string='Restriction Items',
|
||||
copy=True)
|
||||
active = fields.Boolean('Active', default=True,
|
||||
help='If unchecked, it will allow you to hide the '
|
||||
'restriction plan without removing it.')
|
||||
'restriction plan without removing it.')
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<separator string="Pricelist Items"/>
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user