diff --git a/addons/dine360_reservation/models/__pycache__/restaurant_reservation.cpython-310.pyc b/addons/dine360_reservation/models/__pycache__/restaurant_reservation.cpython-310.pyc index 63babc5..b75b662 100644 Binary files a/addons/dine360_reservation/models/__pycache__/restaurant_reservation.cpython-310.pyc and b/addons/dine360_reservation/models/__pycache__/restaurant_reservation.cpython-310.pyc differ diff --git a/addons/dine360_reservation/models/restaurant_reservation.py b/addons/dine360_reservation/models/restaurant_reservation.py index a760419..e035479 100644 --- a/addons/dine360_reservation/models/restaurant_reservation.py +++ b/addons/dine360_reservation/models/restaurant_reservation.py @@ -29,6 +29,16 @@ class RestaurantReservation(models.Model): rec.whatsapp_url = f"https://wa.me/{rec.phone}?text={msg.replace(' ', '%20')}" else: rec.whatsapp_url = False + + def action_whatsapp(self): + self.ensure_one() + if self.whatsapp_url: + return { + 'type': 'ir.actions.act_url', + 'url': self.whatsapp_url, + 'target': 'new', + } + return False state = fields.Selection([ ('draft', 'Draft'), diff --git a/addons/dine360_reservation/views/reservation_views.xml b/addons/dine360_reservation/views/reservation_views.xml index 179f42f..175cad5 100644 --- a/addons/dine360_reservation/views/reservation_views.xml +++ b/addons/dine360_reservation/views/reservation_views.xml @@ -34,7 +34,7 @@
-