Merge branch '11.0' of https://github.com/hootel/hootel into 11.0

This commit is contained in:
Dario Lodeiros
2019-01-16 10:46:12 +01:00
5 changed files with 11 additions and 10 deletions

View File

@@ -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):

View File

@@ -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),

View File

@@ -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"), {

View File

@@ -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)

View File

@@ -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',