diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-11-02 12:14:49 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-11-05 11:06:45 +0000 |
| commit | cba4b45cbf7501f7fe5e7ad3662d7ef4fb00c978 (patch) | |
| tree | da46f64b1fc12185d788dbbf6593c8be04232673 /addons/event/data | |
| parent | f8651f9d380000d2bdbdafc136ca9c173f6d8742 (diff) | |
[FIX] event: Google & Yahoo calendar link broken
Issue
- Install 'Event' module
- Go to 'Event' and select any event
- Click on "Attendees" stat button
- Click on any attendee ( or create one if not any)
- Confirm ( if not already confirm) registration
- Click on "Send by email"
- Change template to 'Event: Registration' then send
- In the chatter, check Google or Yahoo calendar link
Bad link.
Cause
Wrong 'dt_format' pattern generate a broken datetime value;
current format work with time.strftime() but not 'babel' library.
Solution
Update 'dt_format' pattern to match with babel library since it's the
one used in 'format_datetime' func.
> Note that Babel uses different patterns for specifying number and date formats compared to the Python equivalents (such as time.strftime()), which have mostly been inherited from C and POSIX
ref : http://babel.pocoo.org/en/latest/dates.html#pattern-syntax
opw-2370895
closes odoo/odoo#61387
X-original-commit: ab03fa39c716f717ee78c30e41727a85234b5c9d
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'addons/event/data')
| -rw-r--r-- | addons/event/data/email_template_data.xml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/event/data/email_template_data.xml b/addons/event/data/email_template_data.xml index b41bd61c623..8bf5414e11a 100644 --- a/addons/event/data/email_template_data.xml +++ b/addons/event/data/email_template_data.xml @@ -35,8 +35,8 @@ <field name="email_to">${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe}</field> <field name="body_html" type="html"> <table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center"> -% set date_begin = format_datetime(object.event_id.date_begin, tz='UTC', dt_format='%Y%m%dT%H%M%SZ') -% set date_end = format_datetime(object.event_id.date_end, tz='UTC', dt_format='%Y%m%dT%H%M%SZ') +% set date_begin = format_datetime(object.event_id.date_begin, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmssZ') +% set date_end = format_datetime(object.event_id.date_end, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmssZ') % set is_online = 'is_published' in object.event_id and object.event_id.is_published % set event_organizer = object.event_id.organizer_id % set event_address = object.event_id.address_id @@ -87,7 +87,7 @@ <strong>Add this event to your calendar</strong> <a href="https://www.google.com/calendar/render?action=TEMPLATE&text=${object.event_id.name}&dates=${date_begin}/${date_end}&location=${location}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"><img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> Google</a> <a href="/event/${slug(object.event_id)}/ics" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;"><img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> iCal/Outlook</a> - <a href="https://calendar.yahoo.com/?v=60&view=d&type=20&title=${object.event_id.name}&in_loc=${location}&st=${format_datetime(object.event_id.date_begin, tz='UTC', dt_format='%Y%m%dT%H%M%S')}&et=${format_datetime(object.event_id.date_end, tz='UTC', dt_format='%Y%m%dT%H%M%S')}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"> + <a href="https://calendar.yahoo.com/?v=60&view=d&type=20&title=${object.event_id.name}&in_loc=${location}&st=${format_datetime(object.event_id.date_begin, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmss')}&et=${format_datetime(object.event_id.date_end, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmss')}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"> <img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> Yahoo </a> <br /><br /> @@ -259,8 +259,8 @@ <field name="email_to">${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe}</field> <field name="body_html" type="html"> <table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center"> -% set date_begin = format_datetime(object.event_id.date_begin, tz='UTC', dt_format='%Y%m%dT%H%M%SZ') -% set date_end = format_datetime(object.event_id.date_end, tz='UTC', dt_format='%Y%m%dT%H%M%SZ') +% set date_begin = format_datetime(object.event_id.date_begin, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmssZ') +% set date_end = format_datetime(object.event_id.date_end, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmssZ') % set is_online = 'is_published' in object.event_id and object.event_id.is_published % set event_organizer = object.event_id.organizer_id % set event_address = object.event_id.address_id @@ -311,7 +311,7 @@ <strong>Add this event to your calendar</strong> <a href="https://www.google.com/calendar/render?action=TEMPLATE&text=${object.event_id.name}&dates=${date_begin}/${date_end}&location=${location}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"><img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> Google</a> <a href="/event/${slug(object.event_id)}/ics" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;"><img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> iCal/Outlook</a> - <a href="https://calendar.yahoo.com/?v=60&view=d&type=20&title=${object.event_id.name}&in_loc=${location}&st=${format_datetime(object.event_id.date_begin, tz='UTC', dt_format='%Y%m%dT%H%M%S')}&et=${format_datetime(object.event_id.date_end, tz='UTC', dt_format='%Y%m%dT%H%M%S')}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"> + <a href="https://calendar.yahoo.com/?v=60&view=d&type=20&title=${object.event_id.name}&in_loc=${location}&st=${format_datetime(object.event_id.date_begin, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmss')}&et=${format_datetime(object.event_id.date_end, tz='UTC', dt_format='yyyyMMdd\'T\'HHmmss')}" style="padding:3px 5px;border:1px solid #875A7B;color:#875A7B;text-decoration:none;border-radius:3px;" target="new"> <img src="/web_editor/font_to_img/61525/rgb(135,90,123)/16" style="vertical-align:middle;" height="16" alt=""/> Yahoo </a> <br /><br /> |
