From e73c2569e6336fa6fe7cdae1570fa0120c4d7d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Tue, 15 Jan 2019 12:08:22 +0100 Subject: [PATCH 1/5] [FIX] tag_ids hotel_service --- hotel/models/hotel_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotel/models/hotel_service.py b/hotel/models/hotel_service.py index e0f38c16c..6df3808d4 100644 --- a/hotel/models/hotel_service.py +++ b/hotel/models/hotel_service.py @@ -154,7 +154,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): From 0692398e682a5e9664f36ffb6a5061247efff27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Tue, 15 Jan 2019 12:17:08 +0100 Subject: [PATCH 2/5] [ADD] company_id --- hotel/models/hotel_service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hotel/models/hotel_service.py b/hotel/models/hotel_service.py index 6df3808d4..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'), From 523194d9e8adeb618bd19e82f8ee5f95c139c441 Mon Sep 17 00:00:00 2001 From: Pablo Date: Fri, 7 Dec 2018 09:02:35 +0100 Subject: [PATCH 3/5] [FIX] AttributeError: 'hotel.room.type.class' object has no attribute 'class_code' --- .../models/hotel_room_type/exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', From a243ff730577d041ffc941be2d0af9c52657634e Mon Sep 17 00:00:00 2001 From: Pablo Date: Fri, 7 Dec 2018 09:21:25 +0100 Subject: [PATCH 4/5] [ADD] Missing new arguments for board and room type class --- .../components/backend_adapter.py | 4 ++-- .../models/hotel_room_type/common.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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) From 8b9d0d03f9a532df23aa800c3708f4423855242c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Tue, 15 Jan 2019 16:22:18 +0100 Subject: [PATCH 5/5] [FIX] Connector Pricelist Item --- hotel_channel_connector/models/product_pricelist_item/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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),