diff --git a/hotel/models/hotel_service.py b/hotel/models/hotel_service.py index e0f38c16c..eac017044 100644 --- a/hotel/models/hotel_service.py +++ b/hotel/models/hotel_service.py @@ -56,6 +56,7 @@ class HotelService(models.Model): is_board_service = fields.Boolean() # Non-stored related field to allow portal user to see the image of the product he has ordered product_image = fields.Binary('Product Image', related="product_id.image", store=False) + company_id = fields.Many2one(related='folio_id.company_id', string='Company', store=True, readonly=True) channel_type = fields.Selection([ ('door', 'Door'), ('mail', 'Mail'), @@ -154,7 +155,7 @@ class HotelService(models.Model): for record in self: # If company_id is set, always filter taxes by the company folio = record.folio_id or self.env.context.get('default_folio_id') - record.tax_id = record.product_id.taxes_id.filtered(lambda r: not record.company_id or r.company_id == folio.company_id) + record.tax_ids = record.product_id.taxes_id.filtered(lambda r: not record.company_id or r.company_id == folio.company_id) @api.multi def _get_display_price(self, product): diff --git a/hotel_channel_connector/models/product_pricelist_item/common.py b/hotel_channel_connector/models/product_pricelist_item/common.py index 6e25e546e..0dbc238c4 100644 --- a/hotel_channel_connector/models/product_pricelist_item/common.py +++ b/hotel_channel_connector/models/product_pricelist_item/common.py @@ -66,7 +66,7 @@ class BindingProductPricelistItemListener(Component): if not any(record.channel_bind_ids): channel_product_pricelist_item_obj = self.env[ 'channel.product.pricelist.item'] - for pricelist_bind in record.restriction_id.channel_bind_ids: + for pricelist_bind in record.pricelist_id.channel_bind_ids: pricelist_item_bind = channel_product_pricelist_item_obj.search([ ('odoo_id', '=', record.id), ('backend_id', '=', pricelist_bind.backend_id.id), diff --git a/hotel_channel_connector_wubook/components/backend_adapter.py b/hotel_channel_connector_wubook/components/backend_adapter.py index 14a05666d..4ff5bba63 100644 --- a/hotel_channel_connector_wubook/components/backend_adapter.py +++ b/hotel_channel_connector_wubook/components/backend_adapter.py @@ -132,7 +132,7 @@ class WuBookAdapter(AbstractComponent): availability, shortcode[:4], defboard, - rtype=rtype + rtype ) if rcode != 0: raise ChannelConnectorError(_("Can't create room in WuBook"), { @@ -151,7 +151,7 @@ class WuBookAdapter(AbstractComponent): availability, scode, defboard, - rtype=rtype + rtype ) if rcode != 0: raise ChannelConnectorError(_("Can't modify room in WuBook"), { diff --git a/hotel_channel_connector_wubook/models/hotel_room_type/common.py b/hotel_channel_connector_wubook/models/hotel_room_type/common.py index c61ae509c..85813bb05 100644 --- a/hotel_channel_connector_wubook/models/hotel_room_type/common.py +++ b/hotel_channel_connector_wubook/models/hotel_room_type/common.py @@ -9,16 +9,16 @@ class HotelRoomTypeAdapter(Component): _inherit = 'wubook.adapter' _apply_on = 'channel.hotel.room.type' - def create_room(self, shortcode, name, capacity, price, availability): + def create_room(self, shortcode, name, capacity, price, availability, defboard, rtype): return super(HotelRoomTypeAdapter, self).create_room( - shortcode, name, capacity, price, availability) + shortcode, name, capacity, price, availability, defboard, rtype) def fetch_rooms(self): return super(HotelRoomTypeAdapter, self).fetch_rooms() - def modify_room(self, channel_room_id, name, capacity, price, availability, scode): + def modify_room(self, channel_room_id, name, capacity, price, availability, scode, defboard, rtype): return super(HotelRoomTypeAdapter, self).modify_room( - channel_room_id, name, capacity, price, availability, scode) + channel_room_id, name, capacity, price, availability, scode, defboard, rtype) def delete_room(self, channel_room_id): return super(HotelRoomTypeAdapter, self).delete_room(channel_room_id) diff --git a/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py b/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py index 7b045fc28..325e1406e 100644 --- a/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py +++ b/hotel_channel_connector_wubook/models/hotel_room_type/exporter.py @@ -23,7 +23,7 @@ class HotelRoomTypeExporter(Component): binding.total_rooms_count, binding.channel_short_code, 'nb', - binding.class_id and binding.class_id.class_code or False) + binding.class_id and binding.class_id.code_class or False) except ChannelConnectorError as err: self.create_issue( section='room', @@ -42,7 +42,7 @@ class HotelRoomTypeExporter(Component): binding.list_price, binding.total_rooms_count, 'nb', - binding.class_id and binding.class_id.class_code or False) + binding.class_id and binding.class_id.code_class or False) except ChannelConnectorError as err: self.create_issue( section='room',