mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] rate_id conversion pricelist on wubook import reservation
This commit is contained in:
@@ -145,9 +145,14 @@ class HotelReservationImporter(Component):
|
||||
tprice += room_day_price
|
||||
rate_id = brday['rate_id']
|
||||
# TODO: Review different pricelist in the different booked rooms (folio in Odoo)
|
||||
rate_id = rate_id > 0 and rate_id or self.env['channel.backend'].sudo().search([
|
||||
if rate_id > 0:
|
||||
rate_id = self.env['channel.product.pricelist'].search(
|
||||
'external_id', '=', rate_id).odoo_id.id
|
||||
if rate_id <= 0:
|
||||
rate_id = self.env['channel.backend'].sudo().search([
|
||||
('id', '=', self.backend_record.id)
|
||||
]).wubook_parity_pricelist_id.id
|
||||
|
||||
# Get OTA
|
||||
ota_id = self.env['channel.ota.info'].search([
|
||||
('backend_id', '=', self.backend_record.id),
|
||||
@@ -170,7 +175,7 @@ class HotelReservationImporter(Component):
|
||||
'checkout': checkout_str,
|
||||
'adults': persons,
|
||||
'children': book['children'],
|
||||
#'pricelist_id': rate_id,
|
||||
'pricelist_id': rate_id,
|
||||
'reservation_line_ids': reservation_lines,
|
||||
'to_assign': True,
|
||||
'state': is_cancellation and 'cancelled' or 'confirm',
|
||||
|
||||
Reference in New Issue
Block a user