diff --git a/table_reservation_on_website/__manifest__.py b/table_reservation_on_website/__manifest__.py
index 16c4bedc2..10b11287a 100644
--- a/table_reservation_on_website/__manifest__.py
+++ b/table_reservation_on_website/__manifest__.py
@@ -21,7 +21,7 @@
###############################################################################
{
'name': 'Table Reservation On POS And Website',
- 'version': '17.0.1.1.3',
+ 'version': '17.0.1.2.3',
'category': 'eCommerce,Point of Sale',
'summary': 'Reserve tables in POS from website',
'description': """This module enables to reserve tables in POS from website.
diff --git a/table_reservation_on_website/controllers/__init__.py b/table_reservation_on_website/controllers/__init__.py
index 882148379..367d21491 100644
--- a/table_reservation_on_website/controllers/__init__.py
+++ b/table_reservation_on_website/controllers/__init__.py
@@ -21,3 +21,4 @@
###############################################################################
from . import table_reservation_on_website_website_sale
from . import table_reservation_on_website
+from . import pos_config
diff --git a/table_reservation_on_website/controllers/pos_config.py b/table_reservation_on_website/controllers/pos_config.py
new file mode 100644
index 000000000..4a35f645e
--- /dev/null
+++ b/table_reservation_on_website/controllers/pos_config.py
@@ -0,0 +1,31 @@
+from datetime import datetime
+
+from odoo import http
+from odoo.http import request, _logger
+
+
+class ResConfigSettingsController(http.Controller):
+
+ @http.route('/pos/get_opening_closing_hours', type='json', auth='public', methods=['POST'])
+ def get_opening_closing_hours(self):
+ res_config = request.env['res.config.settings'].sudo().search([], limit=1)
+ # Ensure proper time format
+ try:
+ opening_hour = self.float_to_time(float(res_config.pos_opening_hour))
+ closing_hour = self.float_to_time(float(res_config.pos_closing_hour))
+ except ValueError:
+ opening_hour = "00:00"
+ closing_hour = "23:59"
+
+ if res_config:
+ return {
+ 'opening_hour': opening_hour,
+ 'closing_hour': closing_hour
+ }
+ return {'error': 'POS configuration not found'}
+
+ def float_to_time(self, hour_float):
+ """ Convert float hours (e.g., 8.5 → 08:30) to HH:MM format """
+ hours = int(hour_float)
+ minutes = int((hour_float - hours) * 60)
+ return f"{hours:02d}:{minutes:02d}"
diff --git a/table_reservation_on_website/controllers/table_reservation_on_website.py b/table_reservation_on_website/controllers/table_reservation_on_website.py
index e58f7e818..effcbab39 100644
--- a/table_reservation_on_website/controllers/table_reservation_on_website.py
+++ b/table_reservation_on_website/controllers/table_reservation_on_website.py
@@ -30,8 +30,24 @@ class TableReservation(http.Controller):
@http.route(['/table_reservation'], type='http', auth='user', website=True)
def table_reservation(self):
""" For rendering table reservation template """
+ pos_config = request.env['res.config.settings'].sudo().search([],
+ limit=1)
+ try:
+ opening_hour = self.float_to_time(float(pos_config.pos_opening_hour))
+ closing_hour = self.float_to_time(float(pos_config.pos_closing_hour))
+ except ValueError:
+ opening_hour = "00:00"
+ closing_hour = "23:59"
+
return http.request.render(
- "table_reservation_on_website.table_reservation", {})
+ "table_reservation_on_website.table_reservation", {'opening_hour': opening_hour,
+ 'closing_hour': closing_hour})
+
+ def float_to_time(self, hour_float):
+ """ Convert float hours (e.g., 8.5 → 08:30) to HH:MM format """
+ hours = int(hour_float)
+ minutes = int((hour_float - hours) * 60)
+ return f"{hours:02d}:{minutes:02d}"
@http.route(['/restaurant/floors'], type='http', auth='user', website=True)
def restaurant_floors(self, **kwargs):
diff --git a/table_reservation_on_website/doc/RELEASE_NOTES.md b/table_reservation_on_website/doc/RELEASE_NOTES.md
index 9acd544b8..3db2bea20 100644
--- a/table_reservation_on_website/doc/RELEASE_NOTES.md
+++ b/table_reservation_on_website/doc/RELEASE_NOTES.md
@@ -19,3 +19,8 @@
#### Version 17.0.1.1.3
##### BUGFIX
- Updated the module work flow.
+
+#### 18.02.2025
+#### Version 17.0.1.2.3
+##### BUGFIX
+- Updated module to set opening and closing hours.
diff --git a/table_reservation_on_website/models/pos_config.py b/table_reservation_on_website/models/pos_config.py
index 758e845ef..f1925d8de 100644
--- a/table_reservation_on_website/models/pos_config.py
+++ b/table_reservation_on_website/models/pos_config.py
@@ -19,7 +19,7 @@
# If not, see
- Reserve POS Tables Through Website And Pos. -
-+ Reserve POS Tables Through Website And Pos. +
+Key Highlights -
-+ Key Highlights +
+Reserve Tables Through Website.
-Users will be Able to Choose the Tables and Date. -
-+ Reserve Tables Through Website.
+Users will be + Able to Choose the Tables and Date. +
Reserved Tables will be Displayed in POS.
-- Tables Reserved will be Displayed with a Reserved - Label in POS, so it Makes Easy to Identify Reserved Tables. -
-+ Reserved Tables will be Displayed in POS.
++ Tables Reserved will be Displayed with a + Reserved + Label in POS, so it Makes Easy to Identify + Reserved Tables. +