From 79c62d106033285833b6f9f16bb7ac0915f5de3f Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 5 Mar 2019 13:13:56 +0100 Subject: [PATCH] [UPD] use `to_assign` + button highligh --- .../models/inherited_bus_hotel_calendar.py | 1 + .../models/inherited_hotel_reservation.py | 2 +- .../static/src/js/views/hotel_calendar_controller.js | 4 ++-- .../static/src/js/views/hotel_calendar_renderer.js | 4 +++- hotel_calendar_channel_connector/views/actions.xml | 4 ++-- .../views/hotel_reservation.xml | 6 +++--- hotel_channel_connector/models/hotel_reservation/common.py | 7 +++---- hotel_channel_connector/models/inherited_hotel_folio.py | 1 - .../views/channel_hotel_reservation_views.xml | 2 +- .../models/hotel_reservation/common.py | 2 +- .../models/hotel_reservation/importer.py | 4 +--- 11 files changed, 18 insertions(+), 19 deletions(-) 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 @@ - +