diff --git a/hotel_management_odoo/__manifest__.py b/hotel_management_odoo/__manifest__.py
index d35c667f9..a3dd4c139 100644
--- a/hotel_management_odoo/__manifest__.py
+++ b/hotel_management_odoo/__manifest__.py
@@ -21,7 +21,7 @@
################################################################################
{
'name': 'Hotel Management',
- 'version': '16.0.1.0.0',
+ 'version': '16.0.1.1.1',
'category': 'Industries',
'summary': """A complete Hotel Management System that cover all areas of
Hotel services""" ,
diff --git a/hotel_management_odoo/doc/RELEASE_NOTES.md b/hotel_management_odoo/doc/RELEASE_NOTES.md
index 2b201902b..bbad51ef3 100644
--- a/hotel_management_odoo/doc/RELEASE_NOTES.md
+++ b/hotel_management_odoo/doc/RELEASE_NOTES.md
@@ -5,3 +5,9 @@
#### ADD
- Initial commit for Hotel Management
+
+#### 05.07.2024
+#### Version 16.0.1.1.1
+#### UPDATE
+ - Corrected the work flow of deleting and canceling records in room booking model
+ - Updated the workflow maintenance request and cleaning request model(removed a field from each)
diff --git a/hotel_management_odoo/models/cleaning_request.py b/hotel_management_odoo/models/cleaning_request.py
index 6009624a8..9d9871965 100644
--- a/hotel_management_odoo/models/cleaning_request.py
+++ b/hotel_management_odoo/models/cleaning_request.py
@@ -47,8 +47,8 @@ class CleaningRequest(models.Model):
string="Cleaning Type",
help="Choose what is to be cleaned")
room_id = fields.Many2one('hotel.room', string="Room",
- help="Choose the room")
- hotel = fields.Char(string="Hotel", help="cleaning request space in hotel")
+ help="Choose the room", required=True)
+ hotel = fields.Char(string="Hotel", help="Cleaning request space in hotel")
vehicle_id = fields.Many2one('fleet.vehicle.model',
string="Vehicle",
help="Cleaning request from vehicle")
@@ -68,9 +68,16 @@ class CleaningRequest(models.Model):
assigned_id = fields.Many2one('res.users', string="Assigned To",
help="The team member to whom the request is "
"Assigned To")
- domain_partner_ids = fields.Many2many('res.partner',
- string="Domain Partner",
- help="Choose the Domain Partner")
+ team_member_ids = fields.Many2many('res.users', compute='_compute_team_member_ids', store=False,
+ help='For filtering Users')
+
+ @api.depends('team_id')
+ def _compute_team_member_ids(self):
+ for record in self:
+ if record.team_id:
+ record.team_member_ids = record.team_id.member_ids.ids
+ else:
+ record.team_member_ids = []
@api.model
def create(self, vals_list):
@@ -80,12 +87,6 @@ class CleaningRequest(models.Model):
'cleaning.request')
return super().create(vals_list)
- @api.onchange('team_id')
- def _onchange_team_id(self):
- """Function for updating the domain partner ids"""
- self.update(
- {'domain_partner_ids': self.team_id.member_ids.ids})
-
def action_assign_cleaning(self):
"""Button action for updating the state to assign"""
self.update({'state': 'assign'})
diff --git a/hotel_management_odoo/models/maintenance_request.py b/hotel_management_odoo/models/maintenance_request.py
index bfa870f9b..297da381d 100644
--- a/hotel_management_odoo/models/maintenance_request.py
+++ b/hotel_management_odoo/models/maintenance_request.py
@@ -69,7 +69,7 @@ class MaintenanceRequest(models.Model):
help="The type for which the request is creating",
tracking=True)
room_maintenance_ids = fields.Many2many('hotel.room',
- string="Room Maintenance",
+ string="Room Maintenance", required=True,
help="Choose Room Maintenance")
hotel_maintenance = fields.Char(string='Hotel Maintenance',
help="This is the Hotel Maintenance")
@@ -84,9 +84,16 @@ class MaintenanceRequest(models.Model):
support_reason = fields.Char(string='Support',
help="Reason for adding Support")
remarks = fields.Char(string='Remarks', help="Add Remarks")
- domain_partner_ids = fields.Many2many('res.partner',
- string="Partner",
- help="For filtering Users")
+ team_member_ids = fields.Many2many('res.users', compute='_compute_team_member_ids', store=False,
+ help='For filtering Users')
+
+ @api.depends('team_id')
+ def _compute_team_member_ids(self):
+ for record in self:
+ if record.team_id:
+ record.team_member_ids = record.team_id.member_ids.ids
+ else:
+ record.team_member_ids = []
@api.model
def create(self, vals_list):
@@ -96,13 +103,6 @@ class MaintenanceRequest(models.Model):
'maintenance.request')
return super().create(vals_list)
- @api.onchange('team_id')
- def _onchange_team_id(self):
- """Function for filtering the maintenance team user"""
- self.update({
- 'domain_partner_ids': self.team_id.member_ids.ids
- })
-
def action_assign_team(self):
"""Button action for changing the state to team_leader_approve"""
if self.team_id:
diff --git a/hotel_management_odoo/models/room_booking.py b/hotel_management_odoo/models/room_booking.py
index 6da5794ea..3d360b3b9 100644
--- a/hotel_management_odoo/models/room_booking.py
+++ b/hotel_management_odoo/models/room_booking.py
@@ -60,9 +60,7 @@ class RoomBooking(models.Model):
"once")
checkin_date = fields.Datetime(string="Check In",
help="Date of Checkin",
- states={"draft": [("readonly", False)]},
- default=fields.Datetime.now()
- )
+ default=fields.Datetime.now())
checkout_date = fields.Datetime(string="Check Out",
help="Date of Checkout",
states={"draft": [("readonly", False)]},
@@ -238,6 +236,12 @@ class RoomBooking(models.Model):
help="This is the Total Amount for "
"Fleet", tracking=5)
+ def unlink(self):
+ for rec in self:
+ if rec.state != 'cancel' and rec.state != 'draft':
+ raise ValidationError('Cannot delete the Booking. Cancel the Booking ')
+ return super().unlink()
+
@api.model
def create(self, vals_list):
"""Sequence Generation"""
diff --git a/hotel_management_odoo/views/cleaning_request_views.xml b/hotel_management_odoo/views/cleaning_request_views.xml
index 00c80f828..7baf2fd64 100644
--- a/hotel_management_odoo/views/cleaning_request_views.xml
+++ b/hotel_management_odoo/views/cleaning_request_views.xml
@@ -67,13 +67,13 @@
+
-
+
-
+
diff --git a/hotel_management_odoo/views/room_booking_views.xml b/hotel_management_odoo/views/room_booking_views.xml
index f0cbf9843..09fd8ad65 100644
--- a/hotel_management_odoo/views/room_booking_views.xml
+++ b/hotel_management_odoo/views/room_booking_views.xml
@@ -34,7 +34,7 @@
/>