Browse Source

Sep 04: [FIX] Bug Fixed 'hotel_management_odoo'

pull/331/head
Cybrosys Technologies 8 months ago
parent
commit
dbaded6dbf
  1. 2
      hotel_management_odoo/__manifest__.py
  2. 6
      hotel_management_odoo/doc/RELEASE_NOTES.md
  3. 5
      hotel_management_odoo/models/room_booking_line.py
  4. 2
      hotel_management_odoo/report/room_booking_reports.xml
  5. 19
      hotel_management_odoo/wizard/room_booking_detail.py

2
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,

6
hotel_management_odoo/doc/RELEASE_NOTES.md

@ -19,3 +19,9 @@
#### Version 17.0.1.1.3
#### UPDATE
- 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

5
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 "

2
hotel_management_odoo/report/room_booking_reports.xml

@ -45,7 +45,7 @@
<t t-esc="line['checkin_date']"/>
</td>
<td>
<t t-esc="line['checkin_date']"/>
<t t-esc="line['checkout_date']"/>
</td>
<td>
<t t-esc="line['name']"/>

19
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):

Loading…
Cancel
Save