From 58183fe0bdcf58808cba5bc9ed36b2441a109e8d Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 4 Mar 2019 09:29:49 +0100 Subject: [PATCH] [UPD] minor code reordering --- .../models/hotel_reservation/common.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hotel_channel_connector/models/hotel_reservation/common.py b/hotel_channel_connector/models/hotel_reservation/common.py index efafbea2e..9e3229bec 100644 --- a/hotel_channel_connector/models/hotel_reservation/common.py +++ b/hotel_channel_connector/models/hotel_reservation/common.py @@ -112,8 +112,6 @@ class ChannelHotelReservation(models.Model): class HotelReservation(models.Model): _inherit = 'hotel.reservation' - unconfirmed_channel_price = fields.Boolean(related='folio_id.unconfirmed_channel_price') - @api.multi def _set_access_for_channel_fields(self): for record in self: @@ -149,6 +147,14 @@ class HotelReservation(models.Model): to_read = fields.Boolean('To Read', default=False) customer_notes = fields.Text(related='folio_id.customer_notes') + unconfirmed_channel_price = fields.Boolean(related='folio_id.unconfirmed_channel_price') + + @api.onchange('checkin', 'checkout') + def onchange_dates(self): + if not self.is_from_ota: + return super().onchange_dates() + + @api.model def create(self, vals): from_channel = False @@ -228,7 +234,6 @@ class HotelReservation(models.Model): res = super().write(vals) return res - @api.multi def generate_copy_values(self, checkin=False, checkout=False): self.ensure_one() @@ -265,10 +270,6 @@ class HotelReservation(models.Model): def mark_as_readed(self): self.write({'to_read': False, 'to_assign': False}) - @api.onchange('checkin', 'checkout') - def onchange_dates(self): - if not self.is_from_ota: - return super().onchange_dates() class ChannelBindingHotelReservationListener(Component): _name = 'channel.binding.hotel.reservation.listener'