diff --git a/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py b/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
index b1cafb2ac..19c3f56bb 100644
--- a/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
+++ b/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
@@ -77,3 +77,4 @@ class BusHotelCalendar(models.TransientModel):
self.env['bus.bus'].sendone(
(self._cr.dbname, 'hotel.reservation',
HOTEL_BUS_CHANNEL_ID), notif)
+
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
index c3ce0d635..a3a15a726 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
@@ -54,5 +54,5 @@ class HotelReservation(models.Model):
def confirm(self):
for record in self:
if record.to_assign:
- record.write({'to_read': False, 'to_assign': False})
+ record.write({'to_assign': False})
return super(HotelReservation, self).confirm()
diff --git a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js
index 80e80c44b..ab7bb4ac8 100644
--- a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js
+++ b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_controller.js
@@ -45,8 +45,8 @@ var PMSHotelCalendarController = PMSCalendarController.include({
_update_buttons_counter: function (ev) {
this._super(ev);
var self = this;
- var domain_reservations = [['to_read', '=', true]];
- var domain_issues = [['to_read', '=', true]];
+ var domain_reservations = [['to_assign', '=', true]];
+ var domain_issues = [['to_assign', '=', true]];
$.when(
this.model.search_count(domain_reservations),
this.model.search_count(domain_issues),
diff --git a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_renderer.js b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_renderer.js
index f6f0c68b9..08fc365d7 100644
--- a/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_renderer.js
+++ b/hotel_calendar_channel_connector/static/src/js/views/hotel_calendar_renderer.js
@@ -10,12 +10,14 @@ odoo.define('hotel_calendar_channel_connector.PMSHotelCalendarRenderer', functio
update_buttons_counter_channel_connector: function (nreservations, nissues) {
// Cloud Reservations
+ debugger;
var $text = this.$el.find('#btn_channel_manager_request .cloud-text');
+ $text.text(nreservations);
if (nreservations > 0) {
$text.parent().parent().addClass('button-highlight');
$text.parent().addClass('incoming');
- $text.text(nreservations);
} else {
+ $text.parent().parent().removeClass('button-highlight');
$text.parent().removeClass('incoming');
}
diff --git a/hotel_calendar_channel_connector/views/actions.xml b/hotel_calendar_channel_connector/views/actions.xml
index 0375dd0c5..1da90be3c 100644
--- a/hotel_calendar_channel_connector/views/actions.xml
+++ b/hotel_calendar_channel_connector/views/actions.xml
@@ -7,7 +7,7 @@
hotel.reservation
tree,form
- [('to_read','=',True)]
+ [('to_assign','=',True)]
@@ -16,7 +16,7 @@
Channel Connector Issues
hotel.channel.connector.issue
tree,form
- [('to_read','=',True)]
+ [('to_assign','=',True)]
diff --git a/hotel_calendar_channel_connector/views/hotel_reservation.xml b/hotel_calendar_channel_connector/views/hotel_reservation.xml
index 18c97ccad..b260f29e7 100644
--- a/hotel_calendar_channel_connector/views/hotel_reservation.xml
+++ b/hotel_calendar_channel_connector/views/hotel_reservation.xml
@@ -9,7 +9,7 @@
-
+
@@ -19,11 +19,11 @@
-
+
+ attrs="{'invisible':[('to_assign','=', False)]}" />
diff --git a/hotel_channel_connector/models/hotel_reservation/common.py b/hotel_channel_connector/models/hotel_reservation/common.py
index d2948659d..4aa11b50a 100644
--- a/hotel_channel_connector/models/hotel_reservation/common.py
+++ b/hotel_channel_connector/models/hotel_reservation/common.py
@@ -144,7 +144,6 @@ class HotelReservation(models.Model):
readonly=True)
able_to_modify_channel = fields.Boolean(compute=_set_access_for_channel_fields,
string='Is user able to modify channel fields?')
- to_read = fields.Boolean('To Read', default=False)
customer_notes = fields.Text(related='folio_id.customer_notes')
unconfirmed_channel_price = fields.Boolean(related='folio_id.unconfirmed_channel_price')
@@ -164,7 +163,7 @@ class HotelReservation(models.Model):
from_channel = True
user = self.env['res.users'].browse(self.env.uid)
if user.has_group('hotel.group_hotel_call'):
- vals.update({'to_read': True})
+ vals.update({'to_assign': True})
reservation_id = super(HotelReservation, self).create(vals)
backend_id = self.env['channel.hotel.room.type'].search([
@@ -243,7 +242,7 @@ class HotelReservation(models.Model):
'channel_bind_ids': commands,
'customer_notes': self.customer_notes,
'is_from_ota': self.is_from_ota,
- 'to_read': self.to_read,
+ 'to_assign': self.to_assign,
})
return res
@@ -266,7 +265,7 @@ class HotelReservation(models.Model):
@api.multi
def mark_as_readed(self):
- self.write({'to_read': False, 'to_assign': False})
+ self.write({'to_assign': False})
class ChannelBindingHotelReservationListener(Component):
diff --git a/hotel_channel_connector/models/inherited_hotel_folio.py b/hotel_channel_connector/models/inherited_hotel_folio.py
index 503b8783d..189e0ba33 100644
--- a/hotel_channel_connector/models/inherited_hotel_folio.py
+++ b/hotel_channel_connector/models/inherited_hotel_folio.py
@@ -32,7 +32,6 @@ class HotelFolio(models.Model):
def action_confirm(self):
for rec in self:
rec.room_lines.write({
- 'to_read': False,
'to_assign': False,
})
return super().action_confirm()
diff --git a/hotel_channel_connector/views/channel_hotel_reservation_views.xml b/hotel_channel_connector/views/channel_hotel_reservation_views.xml
index 4ef7bf7f0..10bed411d 100644
--- a/hotel_channel_connector/views/channel_hotel_reservation_views.xml
+++ b/hotel_channel_connector/views/channel_hotel_reservation_views.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/common.py b/hotel_channel_connector_wubook/models/hotel_reservation/common.py
index fa945e398..4b18008a6 100644
--- a/hotel_channel_connector_wubook/models/hotel_reservation/common.py
+++ b/hotel_channel_connector_wubook/models/hotel_reservation/common.py
@@ -39,7 +39,7 @@ class HotelReservation(models.Model):
raise ValidationError(_("Can't cancel reservations from OTA's"))
user = self.env['res.users'].browse(self.env.uid)
if user.has_group('hotel.group_hotel_call'):
- self.write({'to_read': True, 'to_assign': True})
+ self.write({'to_assign': True})
res = super(HotelReservation, self).action_cancel()
for record in self:
diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py
index f77b85891..742eb2a5b 100644
--- a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py
+++ b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py
@@ -136,8 +136,7 @@ class HotelReservationImporter(Component):
'reservation_line_ids': reservation_lines,
'price_unit': tprice,
'to_assign': True,
- 'to_read': True,
- 'state': is_cancellation and 'cancelled' or 'draft',
+ 'state': is_cancellation and 'cancelled' or 'confirm',
'room_type_id': room_type_bind.odoo_id.id,
'splitted': split_booking,
'name': room_type_bind and room_type_bind.name,
@@ -201,7 +200,6 @@ class HotelReservationImporter(Component):
'channel_raw_data': json.dumps(book),
'channel_status': str(book['status']),
'channel_status_reason': book.get('status_reason', ''),
- 'to_read': True,
'to_assign': True,
'price_unit': book['amount'],
'customer_notes': book['customer_notes'],