diff --git a/hotel/views/hotel_room_type_restriction_views.xml b/hotel/views/hotel_room_type_restriction_views.xml
index 5e2df2a3f..6227988a3 100644
--- a/hotel/views/hotel_room_type_restriction_views.xml
+++ b/hotel/views/hotel_room_type_restriction_views.xml
@@ -21,9 +21,6 @@
-
-
-
diff --git a/hotel/wizard/wizard_reservation.py b/hotel/wizard/wizard_reservation.py
index a251d808e..60ff30461 100644
--- a/hotel/wizard/wizard_reservation.py
+++ b/hotel/wizard/wizard_reservation.py
@@ -51,7 +51,7 @@ class FolioWizard(models.TransientModel):
@api.model
def _get_default_pricelist(self):
- return self.env.user.hotel_id.pricelist_id.id
+ return self.env.user.hotel_id.default_pricelist_id.id
partner_id = fields.Many2one('res.partner', required=True, string="Customer")
email = fields.Char('E-mail')
@@ -106,7 +106,7 @@ class FolioWizard(models.TransientModel):
vals = {}
pricelist = self.partner_id.property_product_pricelist and \
self.partner_id.property_product_pricelist.id or \
- self.env.user.hotel_id.pricelist_id.id
+ self.env.user.hotel_id.default_pricelist_id.id
vals.update({
'pricelist_id': pricelist,
'email': self.partner_id.email,
diff --git a/hotel_calendar/models/hotel_calendar_management.py b/hotel_calendar/models/hotel_calendar_management.py
index e1511bcd0..670fc346d 100644
--- a/hotel_calendar/models/hotel_calendar_management.py
+++ b/hotel_calendar/models/hotel_calendar_management.py
@@ -218,10 +218,10 @@ class HotelCalendarManagement(models.TransientModel):
vals = {}
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
if not pricelist_id:
- pricelist_id = self.env.user.hotel_id.pricelist_id.id
+ pricelist_id = self.env.user.hotel_id.default_pricelist_id.id
# TODO: refactoring res.config.settings', 'default_restriction_id by the current hotel.property.restriction_id
if not restriction_id:
- restriction_id = self.env.user.hotel_id.restriction_id.id
+ restriction_id = self.env.user.hotel_id.default_restriction_id.id
# TODO: ensure pricelist_id and restriction_id belong to the current hotel
vals.update({'pricelist_id': pricelist_id})
diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py
index daec4ea38..5265762e9 100644
--- a/hotel_calendar/models/inherited_hotel_reservation.py
+++ b/hotel_calendar/models/inherited_hotel_reservation.py
@@ -132,7 +132,7 @@ class HotelReservation(models.Model):
def _hcalendar_room_data(self, rooms):
_logger.warning('_found [%s] rooms for hotel [%s]', len(rooms), self.env.user.hotel_id.id)
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
- pricelist_id = self.env.user.hotel_id.pricelist_id.id
+ pricelist_id = self.env.user.hotel_id.default_pricelist_id.id
json_rooms = [
{
'id': room.id,
@@ -239,7 +239,7 @@ class HotelReservation(models.Model):
@api.model
def get_hcalendar_pricelist_data(self, dfrom_dt, dto_dt):
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
- pricelist_id = self.env.user.hotel_id.pricelist_id.id
+ pricelist_id = self.env.user.hotel_id.default_pricelist_id.id
hotel_id = self.env.user.hotel_id.id
room_types_ids = self.env['hotel.room.type'].search([
('hotel_id', '=', hotel_id)
@@ -294,10 +294,10 @@ class HotelReservation(models.Model):
@api.model
def get_hcalendar_restrictions_data(self, dfrom_dt, dto_dt):
""" Returns the room type restrictions between dfrom_dt and dto_dt
- for the room types of the current_hotel and the its default restriction plan
+ for the room types of the current_hotel within the default restriction plan
"""
hotel_id = self.env.user.hotel_id.id
- restriction_id = self.env.user.hotel_id.restriction_id.id
+ restriction_id = self.env.user.hotel_id.default_restriction_id.id
json_rooms_rests = {}
room_typed_ids = self.env['hotel.room.type'].search([
diff --git a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
index f3944310d..b48807638 100644
--- a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
+++ b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py
@@ -12,7 +12,7 @@ class HotelRoomTypeResrtrictionItem(models.Model):
def create(self, vals):
res = super(HotelRoomTypeResrtrictionItem, self).create(vals)
# TODO: refactoring res.config.settings', 'default_restriction_id by the current hotel.property.restriction_id
- if res.restriction_id.id == self.env.user.hotel_id.restriction_id.id:
+ if res.restriction_id.id == self.env.user.hotel_id.default_restriction_id.id:
self.env['bus.hotel.calendar'].send_restriction_notification({
'restriction_id': res.restriction_id.id,
'date': res.date,
@@ -51,7 +51,7 @@ class HotelRoomTypeResrtrictionItem(models.Model):
@api.multi
def unlink(self):
# TODO: refactoring res.config.settings', 'default_restriction_id by the current hotel.property.restriction_id
- default_restriction_id = self.env.user.hotel_id.restriction_id.id
+ default_restriction_id = self.env.user.hotel_id.default_restriction_id.id
# Construct dictionary with relevant info of removed records
unlink_vals = []
for record in self: