From cba4b45cbf7501f7fe5e7ad3662d7ef4fb00c978 Mon Sep 17 00:00:00 2001 From: "Nasreddin (bon)" Date: Mon, 2 Nov 2020 12:14:49 +0000 Subject: [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 --- addons/event/data/email_template_data.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'addons/event/data/email_template_data.xml') 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 @@ ${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe}
-% 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 @@ Add this event to your calendar Google iCal/Outlook - + Yahoo

@@ -259,8 +259,8 @@ ${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe}
-% 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 @@ Add this event to your calendar Google iCal/Outlook - + Yahoo

-- cgit v1.2.3