mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[BUG] TODO: Review this relationship
This commit is contained in:
@@ -17,6 +17,9 @@ class HotelRoomTypeRestriction(models.Model):
|
||||
active = fields.Boolean('Active', default=True,
|
||||
help='If unchecked, it will allow you to hide the '
|
||||
'restriction plan without removing it.')
|
||||
# TODO: Review this relationship.
|
||||
# 1. How to create a new hotel if hotel_property.restriction_id is required?
|
||||
# 2. If you delete the hotel_id from the hotel is also deleted
|
||||
hotel_ids = fields.One2many('hotel.property',
|
||||
'restriction_id', string='Hotel',
|
||||
default=_get_default_hotel, required=True)
|
||||
|
||||
@@ -21,10 +21,6 @@ class HotelRoomTypeRestrictionItem(models.Model):
|
||||
closed = fields.Boolean('Closed')
|
||||
closed_departure = fields.Boolean('Closed Departure')
|
||||
closed_arrival = fields.Boolean('Closed Arrival')
|
||||
hotel_ids = fields.One2many('hotel.property',
|
||||
'restriction_id', string='Restriction Plan',
|
||||
store=True, readonly=True,
|
||||
related='restriction_id.hotel_ids')
|
||||
|
||||
_sql_constraints = [('room_type_registry_unique',
|
||||
'unique(restriction_id, room_type_id, date)',
|
||||
|
||||
Reference in New Issue
Block a user