table reservation field required apply
This commit is contained in:
parent
2f9eef9536
commit
2358e2e0ff
Binary file not shown.
@ -195,6 +195,12 @@ class TableReservationController(http.Controller):
|
|||||||
if not start_time_str:
|
if not start_time_str:
|
||||||
return request.render("dine360_reservation.reservation_page_template", {'error': 'Please select a time slot.'})
|
return request.render("dine360_reservation.reservation_page_template", {'error': 'Please select a time slot.'})
|
||||||
|
|
||||||
|
if not email:
|
||||||
|
return request.render("dine360_reservation.reservation_page_template", {
|
||||||
|
'error': 'Email is required.',
|
||||||
|
'post': post,
|
||||||
|
})
|
||||||
|
|
||||||
# Convert start_time to datetime object and localize to restaurant timezone (America/Toronto)
|
# Convert start_time to datetime object and localize to restaurant timezone (America/Toronto)
|
||||||
restaurant_tz = pytz.timezone('America/Toronto')
|
restaurant_tz = pytz.timezone('America/Toronto')
|
||||||
try:
|
try:
|
||||||
|
|||||||
Binary file not shown.
@ -11,7 +11,7 @@ class RestaurantReservation(models.Model):
|
|||||||
name = fields.Char(string='Reservation Reference', required=True, copy=False, readonly=True, default=lambda self: _('New'))
|
name = fields.Char(string='Reservation Reference', required=True, copy=False, readonly=True, default=lambda self: _('New'))
|
||||||
customer_name = fields.Char(string='Customer Name', required=True)
|
customer_name = fields.Char(string='Customer Name', required=True)
|
||||||
phone = fields.Char(string='Phone Number', required=True)
|
phone = fields.Char(string='Phone Number', required=True)
|
||||||
email = fields.Char(string='Email')
|
email = fields.Char(string='Email', required=True)
|
||||||
num_people = fields.Integer(string='Number of People', default=1)
|
num_people = fields.Integer(string='Number of People', default=1)
|
||||||
|
|
||||||
floor_id = fields.Many2one('restaurant.floor', string='Floor')
|
floor_id = fields.Many2one('restaurant.floor', string='Floor')
|
||||||
|
|||||||
@ -62,8 +62,8 @@
|
|||||||
<input type="tel" name="phone" class="form-control form-control-lg border-0 shadow-sm" style="background: #f8f9fa; border-radius: 12px; color: #171422 !important; border: 1px solid #fecd4f !important;" placeholder="+1 (647) 000-0000" required="1" t-att-value="post.get('phone') if post else ''"/>
|
<input type="tel" name="phone" class="form-control form-control-lg border-0 shadow-sm" style="background: #f8f9fa; border-radius: 12px; color: #171422 !important; border: 1px solid #fecd4f !important;" placeholder="+1 (647) 000-0000" required="1" t-att-value="post.get('phone') if post else ''"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<label class="form-label fw-bold">Email (Optional)</label>
|
<label class="form-label fw-bold">Email</label>
|
||||||
<input type="email" name="email" class="form-control form-control-lg border-0 shadow-sm" style="background: #f8f9fa; border-radius: 12px; color: #171422 !important; border: 1px solid #fecd4f !important;" placeholder="john@example.com" t-att-value="post.get('email') if post else ''"/>
|
<input type="email" name="email" class="form-control form-control-lg border-0 shadow-sm" style="background: #f8f9fa; border-radius: 12px; color: #171422 !important; border: 1px solid #fecd4f !important;" placeholder="john@example.com" required="1" t-att-value="post.get('email') if post else ''"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<label class="form-label fw-bold">Number of Guests</label>
|
<label class="form-label fw-bold">Number of Guests</label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user