Browse Source

Mar 29 [UPDT]: Updated 'hotel_management_odoo'

pull/313/head
AjmalCybro 1 year ago
parent
commit
6af8b56611
  1. 4
      hotel_management_odoo/__manifest__.py
  2. 5
      hotel_management_odoo/doc/RELEASE_NOTES.md
  3. 5
      hotel_management_odoo/models/room_booking.py
  4. 2
      hotel_management_odoo/static/src/css/dashboard.css
  5. 1
      hotel_management_odoo/static/src/js/dashboard_action.js

4
hotel_management_odoo/__manifest__.py

@ -21,9 +21,9 @@
############################################################################### ###############################################################################
{ {
'name': 'Odoo17 Hotel Management', 'name': 'Odoo17 Hotel Management',
'version': '17.0.1.0.0', 'version': '17.0.1.0.1',
'category': 'Industries', 'category': 'Industries',
'summary': """Hotel Management, Odoo Hotel Management, Hotel, Room Booking odoo, Amenities Odoo, Event management""" , 'summary': """Hotel Management, Odoo Hotel Management, Hotel, Room Booking odoo, Amenities Odoo, Event management""",
'description': """The module helps you to manage rooms, amenities, 'description': """The module helps you to manage rooms, amenities,
services, food, events and vehicles. End Users can book rooms and reserve services, food, events and vehicles. End Users can book rooms and reserve
foods from hotel.""", foods from hotel.""",

5
hotel_management_odoo/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for Hotel Management - Initial commit for Hotel Management
#### 29.03.2024
#### Version 17.0.1.0.1
#### UPDATE
- Add a validation for timezone in dashboard.

5
hotel_management_odoo/models/room_booking.py

@ -650,9 +650,12 @@ class RoomBooking(models.Model):
def get_details(self): def get_details(self):
""" Returns different counts for displaying in dashboard""" """ Returns different counts for displaying in dashboard"""
today = datetime.today() today = datetime.today()
tz_name = False
if self.env.user.tz:
tz_name = self.env.user.tz tz_name = self.env.user.tz
today_utc = pytz.timezone('UTC').localize(today, today_utc = pytz.timezone('UTC').localize(today,
is_dst=False) is_dst=False)
if tz_name:
context_today = today_utc.astimezone(pytz.timezone(tz_name)) context_today = today_utc.astimezone(pytz.timezone(tz_name))
total_room = self.env['hotel.room'].search_count([]) total_room = self.env['hotel.room'].search_count([])
check_in = self.env['room.booking'].search_count( check_in = self.env['room.booking'].search_count(
@ -736,3 +739,5 @@ class RoomBooking(models.Model):
'currency_symbol': self.env.user.company_id.currency_id.symbol, 'currency_symbol': self.env.user.company_id.currency_id.symbol,
'currency_position': self.env.user.company_id.currency_id.position 'currency_position': self.env.user.company_id.currency_id.position
} }
else:
raise ValidationError(_("Please Enter time zone in user settings."))

2
hotel_management_odoo/static/src/css/dashboard.css

@ -5,6 +5,8 @@
} }
.oh_dashboards { .oh_dashboards {
padding: 0px !important; padding: 0px !important;
overflow: auto;
height: 100%;
} }
.dash-card .card{ .dash-card .card{
text-align:center; text-align:center;

1
hotel_management_odoo/static/src/js/dashboard_action.js

@ -33,6 +33,7 @@ async onMounted() {
} }
fetch_data() { fetch_data() {
var self = this; var self = this;
console.log("dafdaafdfadf", this)
//RPC call for retrieving data for displaying on dashboard tiles //RPC call for retrieving data for displaying on dashboard tiles
var def1= jsonrpc('/web/dataset/call_kw/room.booking/get_details' var def1= jsonrpc('/web/dataset/call_kw/room.booking/get_details'
,{ model:'room.booking', ,{ model:'room.booking',

Loading…
Cancel
Save