From 0f0d2616d16ae8fc8978873be1788149e573df20 Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 27 Feb 2019 17:14:23 +0100 Subject: [PATCH] [WIP] Calendar Issues --- .../calendar/hotel_calendar_controller.js | 15 +++-- hotel_calendar/views/actions.xml | 12 ++-- .../static/src/css/view.css | 11 +++- .../src/js/views/hotel_calendar_controller.js | 6 ++ .../views/actions.xml | 2 +- .../views/hotel_reservation.xml | 56 +------------------ 6 files changed, 33 insertions(+), 69 deletions(-) diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js index 348fd320e..d6e801f58 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js @@ -366,7 +366,6 @@ var PMSCalendarController = AbstractController.extend({ }).on('hide.bs.collapse', function(ev){ self.renderer.$el.find('#pms-menu .menu-filter-box h4 i.fa').css({transform: 'rotate(0deg)'}); }); - this._multi_calendar.on('tab_changed', function(ev, active_index){ if (active_index) { self._refresh_view_options(active_index); @@ -856,25 +855,25 @@ var PMSCalendarController = AbstractController.extend({ now_fmt = moment().format(HotelConstants.ODOO_DATE_MOMENT_FORMAT); var domain_checkouts = [ - ['checkout', '=', now_fmt], + ['real_checkout', '=', now_fmt], ['state', 'in', ['booking']], ['reservation_type', 'not in', ['out']] ]; var domain_checkins = [ - ['checkin', '=', now_fmt], + ['real_checkin', '=', now_fmt], ['state', 'in', ['confirm']], ['reservation_type', 'not in', ['out']] ]; var domain_overbookings = [ - ['checkin', '>=', dfrom_fmt], + ['real_checkin', '>=', dfrom_fmt], ['overbooking', '=', true], ['state', 'not in', ['cancelled']] ]; var domain_cancelled = [ '|', '&', - ['checkout', '>', dfrom_fmt], - ['checkout', '<', dto_fmt], - ['checkin', '>=', dfrom_fmt], - ['checkin', '<=', dto_fmt], + ['real_checkout', '>', dfrom_fmt], + ['real_checkout', '<', dto_fmt], + ['real_checkin', '>=', dfrom_fmt], + ['real_checkin', '<=', dto_fmt], ['state', '=', 'cancelled'] ]; diff --git a/hotel_calendar/views/actions.xml b/hotel_calendar/views/actions.xml index 7ea531270..252660f09 100644 --- a/hotel_calendar/views/actions.xml +++ b/hotel_calendar/views/actions.xml @@ -6,9 +6,9 @@ hotel.reservation form tree,form - [('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'), - ('state', 'in', ('confirm')), - ('reservation_type', 'not in', ('out')))] + [('real_checkin','=', datetime.datetime.now().strftime('%Y-%m-%d')), + ('state', 'in', ['confirm']), + ('reservation_type', 'not in', ['out'])] @@ -16,9 +16,9 @@ hotel.reservation form tree,form - [('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'), - ('state', 'in', ('booking')), - ('reservation_type', 'not in', ('out')))] + [('real_checkout','=', datetime.datetime.now().strftime('%Y-%m-%d')), + ('state', 'in', ['booking']), + ('reservation_type', 'not in', ['out'])] diff --git a/hotel_calendar_channel_connector/static/src/css/view.css b/hotel_calendar_channel_connector/static/src/css/view.css index 4592a93b7..6ab3526c9 100644 --- a/hotel_calendar_channel_connector/static/src/css/view.css +++ b/hotel_calendar_channel_connector/static/src/css/view.css @@ -35,9 +35,18 @@ } } -#pms-menu #btn_channel_manager_request.incoming i { +#pms-menu #btn_channel_manager_request .incoming i { animation-name: channel-manager-changes; animation-duration: 2s; animation-iteration-count: infinite; animation-direction: alternate; } + +#pms-menu #btn_channel_manager_request .button-highlight { + color: white; + background-color: #FFA500; +} + +#pms-menu #btn_channel_manager_request .button-highlight i { + color: white; +} \ No newline at end of file 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 292ed8252..80e80c44b 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 @@ -87,6 +87,12 @@ var PMSHotelCalendarController = PMSCalendarController.include({ this._super(notifications); }, + _refresh_view_options: function(active_index) { + /* btn_channel_manager_request */ + this._super(active_index); + + }, + }); return PMSHotelCalendarController; diff --git a/hotel_calendar_channel_connector/views/actions.xml b/hotel_calendar_channel_connector/views/actions.xml index 2b73cce32..0375dd0c5 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_assign','=',True),('to_read','=',True)] + [('to_read','=',True)] diff --git a/hotel_calendar_channel_connector/views/hotel_reservation.xml b/hotel_calendar_channel_connector/views/hotel_reservation.xml index 99aa93d4a..18c97ccad 100644 --- a/hotel_calendar_channel_connector/views/hotel_reservation.xml +++ b/hotel_calendar_channel_connector/views/hotel_reservation.xml @@ -6,61 +6,11 @@ hotel.toassign.reservation.tree hotel.reservation + - - - - - - - - - - - +