Synchronize Google calendar with Odoo¶
Synchronize Google Calendar with Odoo to see and manage meetings from both platforms (updates go in both directions). This integration helps organize schedules, so a meeting is never missed.
Opzet in Google¶
Select (or create) a project¶
Create a new Google API project and enable the Google Calendar API. First, go to the Google API Console and log into the Google account.
Notitie
If this is the first time visiting this page, Google will prompt the user to enter a country and agree to the Terms of Service. Select a country from the drop-down list and agree to the ToS.
Next, click Select a project and select (or create) an API project to configure OAuth in, and store credentials. Click New Project.
Tip
Give the API Project a clear name, like “Odoo Sync”, so it can be easily identified.
Enable Google calendar API¶
Now, click on Enabled APIs and Services in the left menu. Select Enabled APIs and Services again if the Search bar doesn’t appear.
After that, search for Google Calendar API
using the search bar and select Google
Calendar API from the search results. Click Enable.
OAuth-toestemmingsscherm¶
Now that the API project has been created, OAuth should be configured. To do that, click on OAuth consent in the left menu and then select the User Type.
Waarschuwing
Persoonlijke Gmail accounts mogen alleen een Externe gebruikerstype zijn, wat betekent dat Google mogelijk een goedkeuring nodig heeft of dat Scopes moeten worden toegevoegd. Als je echter een Google WorkSpace account gebrukt, kan je een Interne gebruikerstype gebruiken.
Merk ook op dat wanneer de API verbinding in de Externe testmodus staat, er geen goedkeuring nodig is van Google. De gebruikerslimiet in testmodus is ingesteld op 100 gebruikers.
In the second step, OAuth Consent Screen, type Odoo
in the App name field,
select the email address for the User support email field, and type the email address
for the Developer contact information section. Then, click Save and
Continue.
Skip the third step, Save and Continue.
, by clickingNext, if continuing in testing mode (External), add the email addresses being configured under the Test users step, by clicking on Add Users, and then the Save and Continue button. A summary of the app registration appears.
Scroll ten slotte naar beneden en klik op Terug naar dashboard.
Now, the OAuth consent has been configured, and it’s time to create credentials.
Create credentials¶
The Client ID and the Client Secret are both needed to connect Google Calendar to Odoo. This is the last step in the Google console. Begin by clicking Credentials in the left menu. Then, click Create Credentials, and select OAuth client ID, Google will open a guide to create credentials.
Under Website application for the
Application Type field, and type My Odoo Database
for the Name.
Under the Authorized JavaScript Origins section, click + Add URI and type the company’s Odoo full URL address.
Under the Authorized redirect URIs section, click + Add URI and type the company’s Odoo URL address followed by
/google_account/authentication
. Finally, click Create.
A Client ID and Client Secret will appear, copy these to a notepad.
Opzetten in Odoo¶
Once the Client ID and the Client Secret are located, open the Odoo database and go to Google Calendar.
. Check the box next toNext, copy and paste the Client ID and the Client Secret from the Google Calendar API credentials page into their respective fields below the Google Calendar checkbox. Then, click Save.
Sync calendar in Odoo¶
Finally, open the Google sync button to sync Google Calendar with Odoo.
app in Odoo and click on theNotitie
When syncing Google Calendar with Odoo for the first time, the page will redirect to the Google Account. From there, select the Email Account that should have access, then select Continue (should the app be unverifed), and finally select Continue (to give permission for the transfer of data)`.
Now, Odoo Calendar is successfully synced with Google Calendar!
Waarschuwing
Odoo highly recommends testing the Google calendar synchronization on a test database and a test email address (that is not used for any other purpose) before attempting to sync the desired Google Calendar with the user’s production database.
Once a user synchronizes their Google calendar with the Odoo calendar:
Creating an event in Odoo causes Google to send an invitation to all event attendees.
Deleting an event in Odoo causes Google to send a cancellation to all event attendees.
Adding a contact to an event causes Google to send an invitation to all event attendees.
Removing a contact from an event causes Google to send a cancellation to all event attendees.
Events can be created in Google Calendar without sending a notification by selecting Don’t Send when prompted to send invitation emails.