diff --git a/hotel_management_odoo/__manifest__.py b/hotel_management_odoo/__manifest__.py index c1367803f..b153435ab 100644 --- a/hotel_management_odoo/__manifest__.py +++ b/hotel_management_odoo/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################### { 'name': 'Odoo17 Hotel Management', - 'version': '17.0.1.1.4', + 'version': '17.0.1.2.5', 'category': 'Services', 'summary': """Hotel Management, Odoo Hotel Management, Hotel, Room Booking odoo, Amenities Odoo, Event management, Rooms, Events, Food, Booking, Odoo Hotel, Odoo17, Odoo Apps""", 'description': """The module helps you to manage rooms, amenities, diff --git a/hotel_management_odoo/doc/RELEASE_NOTES.md b/hotel_management_odoo/doc/RELEASE_NOTES.md index 3fa57ab68..4ec005c46 100644 --- a/hotel_management_odoo/doc/RELEASE_NOTES.md +++ b/hotel_management_odoo/doc/RELEASE_NOTES.md @@ -18,4 +18,10 @@ #### 04.07.2024 #### Version 17.0.1.1.3 #### UPDATE - - Updated the workflow maintenance request and cleaning request model(removed a field from each) \ No newline at end of file + - Updated the workflow maintenance request and cleaning request model(removed a field from each) + +#### 04.09.2024 +#### Version 17.0.1.2.5 +#### UPDATE + - Updated the workflow in room booking line since a validation error doesnot allows booking after reserved days and +also in room booking report since the checkin date and checkout date was not correct \ No newline at end of file diff --git a/hotel_management_odoo/models/room_booking_line.py b/hotel_management_odoo/models/room_booking_line.py index 306d5ec63..86870d97b 100644 --- a/hotel_management_odoo/models/room_booking_line.py +++ b/hotel_management_odoo/models/room_booking_line.py @@ -150,14 +150,13 @@ class RoomBookingLine(models.Model): rec_room_id = rec.room_line_ids.room_id rec_checkin_date = rec.room_line_ids.checkin_date rec_checkout_date = rec.room_line_ids.checkout_date - if rec_room_id and rec_checkin_date and rec_checkout_date: # Check for conflicts with existing room lines for line in self: if line.id != rec.id and line.room_id == rec_room_id: # Check if the dates overlap - if (rec_checkin_date <= line.checkin_date <= rec_checkout_date or - rec_checkin_date <= line.checkout_date <= rec_checkout_date): + if (rec_checkin_date >= line.checkin_date >= rec_checkout_date or + rec_checkin_date >= line.checkout_date >= rec_checkout_date): raise ValidationError( _("Sorry, You cannot create a reservation for " "this date since it overlaps with another " diff --git a/hotel_management_odoo/report/room_booking_reports.xml b/hotel_management_odoo/report/room_booking_reports.xml index 9f5c7d18a..0fd7d7092 100644 --- a/hotel_management_odoo/report/room_booking_reports.xml +++ b/hotel_management_odoo/report/room_booking_reports.xml @@ -45,7 +45,7 @@ - + diff --git a/hotel_management_odoo/wizard/room_booking_detail.py b/hotel_management_odoo/wizard/room_booking_detail.py index f9dd16bda..0778f5acf 100644 --- a/hotel_management_odoo/wizard/room_booking_detail.py +++ b/hotel_management_odoo/wizard/room_booking_detail.py @@ -86,25 +86,22 @@ class RoomBookingWizard(models.TransientModel): ) room_booking = self.env["room.booking"].search_read( domain=domain, - fields=["partner_id", "name", "checkin_date", "checkout_date"], + fields=["partner_id", "name"], ) for rec in room_booking: - rooms = ( - self.env["room.booking"] - .browse(rec["id"]) - .room_line_ids.room_id.mapped("name") - ) + rooms = self.env["room.booking"].browse(rec["id"]) rec["partner_id"] = rec["partner_id"][1] - for room in rooms: + for line in rooms.room_line_ids: if self.room_id: - if self.room_id.name == room: - rec["room_id"] = room + if self.room_id.id == line.room_id.id: + rec["room_id"] = line.room_id.name + rec["checkin_date"] = line.checkin_date.date() + rec["checkout_date"] = line.checkout_date.date() room_list.append(rec) else: rec_copy = rec.copy() - rec_copy["room_id"] = room + rec_copy["room_id"] = line.room_id.name room_list.append(rec_copy) - return room_list def get_xlsx_report(self, data, response):