Outlook日历同步

Synchronizing a user’s Outlook Calendar with Odoo is useful for keeping track of tasks and appointments across all related applications.

Microsoft Azure setup

To sync the Outlook Calendar with Odoo’s Calendar, a Microsoft Azure account is required. Creating an account is free for users who have never tried, or paid for, Azure. For more information, view the account options on the Azure website.

Refer to Microsoft’s documentation on how to set up a Microsoft Entra ID (formally called Microsoft Azure Active Directory (Azure AD)). This is an API console to manage and register Microsoft applications.

Existing Microsoft Entra ID users should log in at the Microsoft Azure developer portal. Next, select View under the section labeled Manage Microsoft Entra ID.

Register application

After logging in with the Microsoft Entra ID, register an application.

To create an application, click + Add in the top menu. From the resulting drop-down menu, select App Registration.

Microsoft Azure management page with + Add and App Registration menu highlighted.

Enter a unique Name for the connected application.

Choosing the appropriate Supported account type is essential, or else the connected application will not work. Users who wish to connect their Outlook Calendar to Odoo should select the Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) option for Supported account types.

When configuring the Redirect URI, choose the Web option from the first drop-down menu. Then, enter the Odoo database URI (URL) followed by /microsoft_account/authentication.

Example

Enter https://yourdbname.odoo.com/microsoft_account/authentication for the Redirect URI. Replace yourdbname.odoo.com with the URL.

小技巧

Ensure the database’s URL (domain) used in the URI is the exact same domain as the one configured on the web.base.url system parameter.

Access the web.base.url by activating developer mode, and navigating to Settings app ‣ Technical header menu ‣ Parameters section ‣ System Parameters. Then, select it from the Key list on the System Parameters page.

Microsoft Azure AD门户中的“支持的帐户类型”和“重定向URI”设置。

For more information on the restrictions and limitations of URIs, check Microsoft’s Redirect URI (reply URL) restrictions and limitations page.

Finally, on the application registration page, click Register button to complete the application registration. The Application (client) ID is produced. Copy this value, as it is needed later, in the 在Odoo中的配置.

Application client ID highlighted in the essentials section of the newly created application.

Create client secret

The second credential needed to complete the synchronization of the Microsoft Outlook Calendar is the Client Secret. The user must add a client secret, as this allows Odoo to authenticate itself, requiring no interaction from the user’s side. Certificates are optional.

To add a client secret, click Certificates & secrets in the left menu. Then click + New client secret to create the client secret.

New client secret page with certificates and secrets menu and new client secret option highlighted.

Next, type a Description, and select when the client secret Expires. Available options include: 90 days (3 months), 365 days (12 months), 545 days (18 months), 730 days (24 months) or Custom. The Custom option allows the administrator to set a Start and End date.

Finally, click Add to Add a client secret.

小技巧

Since resetting the synchronization can be tricky, Odoo recommends setting the maximum allowed expiration date for the client secret (24 months or custom), so there is no need to re-synchronize soon.

Copy the Value for use in the next section.

警告

Client secret values cannot be viewed, except immediately after creation. Be sure to save the secret when created before leaving the page.

在Odoo中的配置

In the Odoo database, go to Settings app ‣ Integrations section, and tick the checkbox beside the Outlook Calendar setting. Remember to click Save to implement the changes.

在Odoo中激活了"Outlook日历"设置。

From the Microsoft Azure portal, under the Overview section of the application, copy the Application (Client) ID, if it has not already been copied, and paste it into the Client ID field in Odoo.

Microsoft Azure 门户中的“客户端 ID”。

Copy the previously-acquired Value (Client Secret Value), and paste it into the Client Secret field in Odoo.

需要从Microsoft复制到Odoo的"客户端密钥"令牌。

最后,在 Odoo 设置 ‣ 通用设置 页面,点击 保存

与Outlook同步

警告

Odoo强烈建议在尝试将所需的Outlook日历与用户的生产数据库同步之前,在测试数据库和测试电子邮件地址(不用于任何其他目的)上测试Outlook日历同步。

如果用户在同步Outlook日历之前在Odoo日历上有任何过去、现在或未来的事件,Outlook将把同步期间从Odoo日历中提取的事件视为新事件,导致Outlook向所有事件参与者发送电子邮件通知。

为避免向所有过去、现在和未来的事件参与者发送不必要的电子邮件,用户必须在第一次同步之前将Odoo日历中的事件添加到Outlook日历中,从Odoo中删除这些事件,然后开始同步。

即使将Odoo日历与Outlook日历同步,Outlook仍会在每次编辑事件(创建、删除、取消归档或更改事件日期/时间)时向所有参与者发送通知,没有例外。这是一个无法从Odoo方面修复的限制。

简而言之,一旦用户将他们的Outlook日历与Odoo日历同步:

  • 在Odoo中创建一个事件会导致Outlook向所有参与者发送邀请。

  • 在Odoo中删除一个事件会导致Outlook向所有事件参与者发送取消通知。

  • 在Odoo中取消存档一个事件会导致Outlook向所有事件参与者发送邀请。

  • 在Odoo中归档一个事件会导致Outlook向所有事件参与者发送取消通知。

  • 将联系人添加到事件中会导致 Outlook 向所有事件参与者发送邀请。

  • 从事件中删除联系人会导致 Outlook 向所有事件参与者发送取消通知。

同步Odoo日历和Outlook

In the Odoo database, open to the Calendar module, and click the Outlook sync button on the right-side of the page, beneath the monthly calendar.

Odoo日历中的“Outlook”同步按钮。

The synchronization is a two-way process, meaning that events are reconciled in both accounts (Outlook and Odoo). The page redirects to a Microsoft login page, and the user is asked to log in to their account, if they are not already. Finally, grant the required permissions by clicking Accept.

Authentication process on Microsoft Outlook OAuth page.

注解

All users that want to use the synchronization simply need to sync their calendar with Outlook. The configuration of Microsoft’s Azure account is only done once, as Microsoft Entra ID tenants’ client IDs and client secrets are unique, and help the user manage a specific instance of Microsoft cloud services for internal and external users.

故障排除

There may be times when the Microsoft Outlook Calendar account does not sync correctly with Odoo. Sync issues can be seen in the database logs.

In these cases, the account needs troubleshooting. A reset can be performed using the Reset Account button, which can be accessed by navigating to Settings app ‣ Manage Users. Then, select the user to modify the calendar, and click on the Calendar tab.

Send to voicemail as a last resort options highlighted on the Forwardings tab of the user.

Then, click OK to begin the call.

高级

The following reset options are available for troubleshooting Microsoft Outlook Calendar sync with Odoo:

在Odoo中激活了"Outlook日历"设置。

图片

  • 字体样式:使用默认字体样式之一。

  • Delete from the current Microsoft Calendar account: delete the events from Microsoft Outlook Calendar.

  • 从视图中删除: 从报表的视图中删除该元素。

  • Delete from both: delete the events from both Microsoft Outlook Calendar and Odoo calendar.

选择

  • Synchronize only new events: sync new events on Microsoft Outlook Calendar and/or Odoo calendar.

  • Synchronize all existing events: sync all events on Microsoft Outlook Calendar and/or Odoo calendar.

Click Confirm after making the selection to modify the user’s events and the calendar synchronization.