From 72003ca530722a38fa53dd46567f6b948ab70e73 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 21 Jun 2018 16:51:37 +0200 Subject: [PATCH] [FIX] calendar: ok button on notifications should notify ack Have an event starting *now* with a reminder, let's say 15 minutes After saving the event, the notification pops up. Click "OK" Before this commit no call to the server was done, implying that the notification will keep on popping up untimely This was because, the widget was destroyed, hence its parents got removed before the triggering up of rpc call After this commit, we make sure we destroy the widget *after* the rpc OPW 1860169 closes #25399 --- addons/calendar/static/src/js/base_calendar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index 3752b7aa94a..e09222b6025 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -40,8 +40,10 @@ var CalendarNotification = Notification.extend({ }, 'click .link2showed': function() { - this.destroy(true); - this._rpc({route: '/calendar/notify_ack'}); + var self = this; + this._rpc({route: '/calendar/notify_ack'}).always(function() { + self.destroy(); + }); }, }); },