mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] Wubook revision
This commit is contained in:
@@ -68,7 +68,7 @@ class ChannelHotelRoomTypeAvailability(models.Model):
|
|||||||
_inherits = {'hotel.room.type.availability': 'odoo_id'}
|
_inherits = {'hotel.room.type.availability': 'odoo_id'}
|
||||||
_description = 'Channel Availability'
|
_description = 'Channel Availability'
|
||||||
|
|
||||||
avail = fields.Integer("Avail", default=0, readonly=True)
|
# avail = fields.Integer("Avail", default=0, readonly=True)
|
||||||
odoo_id = fields.Many2one(comodel_name='hotel.room.type.availability',
|
odoo_id = fields.Many2one(comodel_name='hotel.room.type.availability',
|
||||||
string='Pricelist',
|
string='Pricelist',
|
||||||
required=True,
|
required=True,
|
||||||
|
|||||||
@@ -109,9 +109,15 @@ class HotelReservationImporter(Component):
|
|||||||
('backend_id', '=', self.backend_record.id),
|
('backend_id', '=', self.backend_record.id),
|
||||||
('ota_id', '=', str(book['id_channel'])),
|
('ota_id', '=', str(book['id_channel'])),
|
||||||
], limit=1)
|
], limit=1)
|
||||||
|
binding_vals = {
|
||||||
vals = {
|
|
||||||
'backend_id': self.backend_record.id,
|
'backend_id': self.backend_record.id,
|
||||||
|
'external_id': rcode,
|
||||||
|
'ota_id': ota_id and ota_id.id,
|
||||||
|
'ota_reservation_id': crcode,
|
||||||
|
'channel_raw_data': json.dumps(book),
|
||||||
|
'channel_modified': book['was_modified'],
|
||||||
|
}
|
||||||
|
vals = {
|
||||||
'checkin': checkin_str,
|
'checkin': checkin_str,
|
||||||
'checkout': checkout_str,
|
'checkout': checkout_str,
|
||||||
'adults': persons,
|
'adults': persons,
|
||||||
@@ -119,19 +125,14 @@ class HotelReservationImporter(Component):
|
|||||||
'reservation_lines': reservation_lines,
|
'reservation_lines': reservation_lines,
|
||||||
'price_unit': tprice,
|
'price_unit': tprice,
|
||||||
'to_assign': True,
|
'to_assign': True,
|
||||||
'external_id': rcode,
|
|
||||||
'ota_id': ota_id and ota_id.id,
|
|
||||||
'ota_reservation_id': crcode,
|
|
||||||
'channel_status': str(book['status']),
|
|
||||||
'to_read': True,
|
'to_read': True,
|
||||||
'state': is_cancellation and 'cancelled' or 'draft',
|
'state': is_cancellation and 'cancelled' or 'draft',
|
||||||
'room_type_id': room_type_bind.odoo_id.id,
|
'room_type_id': room_type_bind.odoo_id.id,
|
||||||
'splitted': split_booking,
|
'splitted': split_booking,
|
||||||
'channel_raw_data': json.dumps(book),
|
|
||||||
'channel_modified': book['was_modified'],
|
|
||||||
'product_id': room_type_bind and room_type_bind.product_id.id,
|
|
||||||
'name': room_type_bind and room_type_bind.name,
|
'name': room_type_bind and room_type_bind.name,
|
||||||
|
'channel_bind_ids': [(0, False, binding_vals)]
|
||||||
}
|
}
|
||||||
|
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
Reference in New Issue
Block a user