Skip to content

[16.0][ADD] calendar_shared_ics#199

Draft
ntsirintanis wants to merge 4 commits intoOCA:16.0from
Therp:16.0-calendar_shared_ics
Draft

[16.0][ADD] calendar_shared_ics#199
ntsirintanis wants to merge 4 commits intoOCA:16.0from
Therp:16.0-calendar_shared_ics

Conversation

@ntsirintanis
Copy link
Copy Markdown

This module allows sharing an Odoo calendar as a read-only ICS feed that can be
subscribed to in external calendar clients such as Outlook, Google Calendar,
and Thunderbird.

The calendar is exposed via a public URL protected by an access token and can be
added as a network calendar (ICS / webcal://). External calendar clients periodically
refresh the feed, providing near-real-time visibility of Odoo events without any
write-back capability.

</group>
<group string="Subscription link">
<field name="share_webcal_url" readonly="1" widget="copy" />
<field name="share_url" readonly="1" widget="copy" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntsirintanis Correct widget should be CopyClipboardChar:
image

res = super()._compute_access_url()
base_url = self.get_base_url()
for cal in self:
cal.access_url = f"{base_url}/calendar/shared/{cal.id}/ics"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntsirintanis Doesn't this need a portal view?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, this is just the url for that given calendar.shared.ics record, but without the access_token. It is just for being displayed

else:
users = self.env["res.users"].search(["|"] + user_domain)
partner_ids = users.mapped("partner_id").ids
return {"domain": {"partner_id": [("id", "in", partner_ids)]}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntsirintanis Two things here:

  1. Returning a domain is deprecated in v16 in favor of using a computed function.
    E.g in partner_contact_address_default and usage in the view

  2. The current domain filter somehow doesn't work well when you include portal users:

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Copy Markdown
Member

@Kiplangatdan Kiplangatdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntsirintanis Retested, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants