forked from alaguraj/odoo-testing-addons
Add website table reservation form and success page.
This commit is contained in:
parent
6c78c14c2a
commit
73453d0e26
@ -6,10 +6,10 @@
|
|||||||
<xpath expr="//body" position="inside">
|
<xpath expr="//body" position="inside">
|
||||||
<a href="/" class="o_dashboard_return_btn d-print-none" title="Back to Dashboard"
|
<a href="/" class="o_dashboard_return_btn d-print-none" title="Back to Dashboard"
|
||||||
style="position: fixed; bottom: 20px; right: 20px; z-index: 99999;
|
style="position: fixed; bottom: 20px; right: 20px; z-index: 99999;
|
||||||
background-color: #d6111e; color: #ffff; padding: 12px 24px;
|
background-color: #d6111e; color: #ffff !important; padding: 12px 24px;
|
||||||
border-radius: 50px; text-decoration: none; font-weight: bold;
|
border-radius: 50px; text-decoration: none; font-weight: bold;
|
||||||
box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: flex; align-items: center;
|
box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: flex; align-items: center;
|
||||||
gap: 8px; transition: all 0.3s ease; border: 2px solid #04121D; font-family: sans-serif;">
|
gap: 8px; transition: all 0.3s ease; border: 2px solid #ffffffff !important; font-family: sans-serif;">
|
||||||
<i class="fa fa-th-large" style="font-size: 18px;"></i>
|
<i class="fa fa-th-large" style="font-size: 18px;"></i>
|
||||||
<span>Back to Dashboard</span>
|
<span>Back to Dashboard</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Binary file not shown.
@ -91,8 +91,16 @@ class RestaurantReservation(models.Model):
|
|||||||
self.end_time = self.start_time + timedelta(hours=1)
|
self.end_time = self.start_time + timedelta(hours=1)
|
||||||
|
|
||||||
def action_confirm(self):
|
def action_confirm(self):
|
||||||
|
self.ensure_one()
|
||||||
self.write({'state': 'confirmed'})
|
self.write({'state': 'confirmed'})
|
||||||
self._send_confirmation_notification()
|
self._send_confirmation_notification()
|
||||||
|
# Auto-open WhatsApp on confirmation
|
||||||
|
if self.whatsapp_url:
|
||||||
|
return {
|
||||||
|
'type': 'ir.actions.act_url',
|
||||||
|
'url': self.whatsapp_url,
|
||||||
|
'target': 'new',
|
||||||
|
}
|
||||||
|
|
||||||
def action_complete(self):
|
def action_complete(self):
|
||||||
self.write({'state': 'completed'})
|
self.write({'state': 'completed'})
|
||||||
|
|||||||
@ -122,7 +122,20 @@
|
|||||||
<div class="col-12"><strong>Time:</strong> <t t-esc="reservation.start_time.strftime('%B %d, %Y at %I:%M %p')"/></div>
|
<div class="col-12"><strong>Time:</strong> <t t-esc="reservation.start_time.strftime('%B %d, %Y at %I:%M %p')"/></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<a t-att-href="reservation.whatsapp_url" id="whatsapp_auto_link" class="btn btn-lg text-white mb-3" target="_blank" style="background: #25D366; border-radius: 12px; padding-left: 40px; padding-right: 40px; font-weight: 600;">
|
||||||
|
<i class="fa fa-whatsapp me-2"/>SEND WHATSAPP CONFIRMATION
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
<a href="/" class="btn btn-lg text-dark" style="background: #fecd4f; border-radius: 12px; padding-left: 40px; padding-right: 40px; font-weight: 600;">BACK TO HOME</a>
|
<a href="/" class="btn btn-lg text-dark" style="background: #fecd4f; border-radius: 12px; padding-left: 40px; padding-right: 40px; font-weight: 600;">BACK TO HOME</a>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
setTimeout(function() {
|
||||||
|
var waLink = document.getElementById('whatsapp_auto_link');
|
||||||
|
if (waLink) {
|
||||||
|
waLink.click();
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user