Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Calendar

Entity: calendar.event

Compute Method: _compute_google_calendar_url

Inputs Method Outputs
for event in self:
            if not event.allday:
                url_date_start = fields.Datetime.from_string(event.start).strftime('%Y%m%dT%H%M%SZ')
                url_date_stop = fields.Datetime.from_string(event.stop).strftime('%Y%m%dT%H%M%SZ')
            else:
                url_date_start = fields.Date.from_string(event.start_date).strftime('%Y%m%d')
                url_date_stop = fields.Date.from_string(event.stop_date).strftime('%Y%m%d')
            params = {
                'action': 'TEMPLATE',
                'text': event._get_customer_summary(),
                'dates': f'{url_date_start}/{url_date_stop}',
                'details': event._get_customer_description(),
            }
            if event.location:
                params.update(location=event.location.replace(', ', ' '))
            event.google_calendar_url = 'https://www.google.com/calendar/render?' + url_encode(params)

Back to entity