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.

Create a new API project to store credentials.

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.

Enable APIs and Services on the API Project.

After that, search for Google Calendar API using the search bar and select Google Calendar API from the search results. Click Enable.

Enable the Google Calendar API.

Create credentials

De Client ID en de Client Secret zijn beide nodig om Google Agenda te verbinden met Odoo. Dit is de laatste stap in de Google console. Klik eerst op Credentials in het linkermenu. Klik vervolgens op Create Credentials en selecteer OAuth client ID. Google zal een handleiding openen om referenties aan te maken.

Selecteer onder Create OAuth Client ID Website application voor het Application Type veld en typ My Odoo Database voor het Name veld.

  • Klik onder het Authorized JavaScript Origins gedeelte op + Add URI en typ het volledige Odoo URL adres van het bedrijf.

  • Klik onder het Authorized redirect URIs gedeelte op + Add URI en typ het Odoo URL adres van het bedrijf gevolgd door /google_account/authentication. Klik ten slotte op Create.

Voeg de geautoriseerde JavaScript-oorsprong en de geautoriseerde redirect URI's toe.

Er verschijnt een Client ID en Client Secret, kopieer deze naar een kladblok.

Opzetten in Odoo

Zodra de Client ID en het Client Secret zijn gevonden, open je de Odoo database en ga je naar Instellingen ‣ Algemene instellingen ‣ Integraties ‣ Google Agenda. Vink het vakje naast Google Calendar aan.

Het selectievakje Google Agenda in Algemene instellingen.

Kopieer en plak vervolgens de Client ID en het Client Secret van de Google Calendar API credentials pagina in de respectievelijke velden onder het Google Calendar selectievakje. Klik vervolgens op Opslaan.

Agenda synchroniseren in Odoo

Open tenslotte de Calendar app in Odoo en klik op de Google sync knop om Google Agenda te synchroniseren met Odoo.

Klik op de Google sync knop in Odoo Agenda om Google Agenda te synchroniseren met Odoo.

Notitie

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)`.

Geef Odoo toestemming om Google Agenda te openen.

Odoo Agenda is nu succesvol gesynchroniseerd met Google Agenda!

Waarschuwing

Odoo raadt ten zeerste aan om de Google agenda synchronisatie te testen op een testdatabase en een test e-mailadres (dat niet voor andere doeleinden wordt gebruikt) voordat je probeert de gewenste Google agenda te synchroniseren met de productiedatabase van de gebruiker.

Zodra een gebruiker zijn Google agenda synchroniseert met de Odoo agenda:

  • Als je een evenement aanmaakt in Odoo, stuurt Google een uitnodiging naar alle deelnemers aan het evenement.

  • Het verwijderen van een evenement in Odoo zorgt ervoor dat Google een annulering stuurt naar alle deelnemers van het evenement.

  • Het toevoegen van een contact aan een evenement zorgt ervoor dat Google een uitnodiging stuurt naar alle deelnemers aan het evenement.

  • Als je een contact verwijdert van een evenement, stuurt Google een annulering naar alle deelnemers van het evenement.

Evenementen kunnen worden aangemaakt in Google Calendar zonder een melding te versturen door Niet versturen te selecteren wanneer wordt gevraagd om uitnodigingsmails te versturen.

Synchronisatieproblemen oplossen

Het kan voorkomen dat het Google Calendar account niet correct synchroniseert met Odoo. Synchronisatieproblemen kun je zien in de 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 the Calendar tab.

Resetknoppen gemarkeerd op het kalendertabblad van de gebruiker.

Klik vervolgens op Reset Account onder de juiste agenda.

Reset Opties

De volgende resetopties zijn beschikbaar voor het oplossen van problemen met Google agenda synchronisatie met Odoo:

Google agenda reset opties in Odoo.

Gebruikers bestaande gebeurtenissen:

  • Laat ze onaangeroerd: geen wijzigingen aan de gebeurtenissen.

  • Verwijderen uit het huidige Google Agenda-account: verwijder de gebeurtenissen uit Google Calendar.

  • Verwijderen uit Odoo: verwijder de gebeurtenissen uit de Odoo-kalender.

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

Volgende synchronisatie:

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

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

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

Google OAuth FAQ

At times there can be misconfigurations that take place, and troubleshooting is needed to resolve the issue. Below are the most common errors that may occur when configuring the Google Calendar for use with Odoo.

Production vs. testing publishing status

Door Productie te kiezen als Publicatiestatus (in plaats van Testen) wordt de volgende waarschuwing weergegeven:

OAuth is limited to 100 sensitive scope logins until the OAuth consent screen is verified. This may require a verification process that can take several days.

Om deze waarschuwing te corrigeren, navigeer je naar het Google API Platform. Als de Publicatiestatus In productie is, klik dan op Terug naar testen om het probleem op te lossen.

Geen testgebruikers toegevoegd

If no test users are added to the OAuth consent screen, then an Error 403: access_denied populates.

403 Fout bij toegang geweigerd.

To correct this error, return to the OAuth consent screen, under APIs & Services, and add test users to the app. Add the email to be configured in Odoo.

Type toepassing

Bij het aanmaken van de referenties (OAuth Client ID en Client Secret), als Desktop App is geselecteerd voor het Application Type, verschijnt er een Authorization Error (Error 400:redirect_uri_mismatch).

Error 400 Redirect URI Mismatch.

To correct this error, delete the existing credentials, and create new credentials, by selecting Web Application for the Application Type.

Klik dan onder Authorized redirect URIs op ADD URI en typ: https://yourdbname.odoo.com/google_account/authentication in het veld en zorg ervoor dat je uwdbnaam in de URL vervangt door de echte Odoo databasenaam.

Tip

Zorg ervoor dat het domein (gebruikt in de URI: https://yourdbname.odoo.com/google_account/authentication) exact hetzelfde domein is als geconfigureerd in de web.base.url systeemparameter.

Krijg toegang tot de web.base.url door ontwikkelmodus te activeren en te navigeren naar :menuselectie:`Instellingen app --> Technisch hoofdmenu --> Parameters sectie --> Systeemparameters`.