[FIX] calendar_sms: send reminder sms
Steps to reproduce:
- Create a contact with email address and mobile number set.
- In Calendar > Reminders, create a reminder of type SMS and one of type Email (e.g. 24 hours before the event).
- Create an event, with the created contact as attendee, and the SMS and Email reminders you have created.
- Less than 24 hours before the event, run manually the scheduled action « Calendar : Event Reminder ».
- Go to Technical > Messages. You’ll see that the email reminder was triggered, but no SMS was sent. It seems the scheduled action doesn’t have any effect on the SMS type of reminder.
Solution:
In the `_send_reminder()` method, there was a confusion between alarm_id and event_id.
The correction has been made so it considers every events returned by the sql-query for which there is a `sms` reminder set and use the correct alarm_id for this event. (https://github.com/odoo/odoo/blob/543af27c7d6836ffac9e80ff8490b6ddbd849221/addons/calendar/models/calendar_alarm_manager.py#L149-L161)
Please note that in comparison with the email reminder there is no check for attendency (https://github.com/odoo/odoo/blob/543af27c7d6836ffac9e80ff8490b6ddbd849221/addons/calendar/models/calendar_alarm_manager.py#L177)
-> That is because this check is done a little further in the code. See: https://github.com/odoo/odoo/blob/744ad956f944065cf98fd89e3d1078de32569897/addons/calendar_sms/models/calendar_event.py#L10-L14
closes odoo/odoo#81438
X-original-commit: d14c708405bacb2935bcd6a11966816b50e3e477
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>