From abef29416dc2ddb7f3a609b92deb7b5d94b85904 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 16 Sep 2019 14:13:58 +0200 Subject: [PATCH] [UPD] get filters by hotel --- .../js/views/calendar/hotel_calendar_model.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js index b53974c66..96eb3b4aa 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js @@ -78,7 +78,10 @@ return AbstractModel.extend({ }); }, get_floors: function() { - var domain = [['hotel_ids', 'in', Session.hotel_id]]; + var domain = [('|', + ['hotel_ids', 'in', Session.hotel_id], + ['hotel_ids', '=', false] + )]; return this._rpc({ model: 'hotel.floor', method: 'search_read', @@ -87,7 +90,11 @@ return AbstractModel.extend({ }); }, get_amenities: function() { - var domain = [['hotel_ids', 'in', Session.hotel_id]]; + var domain = [('|', + ['hotel_ids', 'in', Session.hotel_id], + ['hotel_ids', '=', false] + )]; + // TODO: Filter rooms by amenities is not working return this._rpc({ model: 'hotel.amenity', method: 'search_read', @@ -96,7 +103,10 @@ return AbstractModel.extend({ }); }, get_room_type_class: function() { - var domain = [['hotel_ids', 'in', Session.hotel_id]]; + var domain = [('|', + ['hotel_ids', 'in', Session.hotel_id], + ['hotel_ids', '=', false] + )]; return this._rpc({ model: 'hotel.room.type.class', method: 'search_read',