[IMP] Google Oauth Docs edits final review

closes odoo/documentation#4299

X-original-commit: 5b63bfcba9
Signed-off-by: Zachary Straub (zst) <zst@odoo.com>
This commit is contained in:
Timothy Kukulka (tiku) 2023-03-29 19:14:39 +00:00 committed by Zachary Straub (ZST)
parent 59d98ce8a7
commit 13d03c4771
9 changed files with 246 additions and 182 deletions

View File

@ -21,64 +21,87 @@ Setup in Google
Create a new project Create a new project
-------------------- --------------------
To get started, go to the `Google API Platform To get started, go to the `Google API Console <https://console.developers.google.com>`_. Log in
<https://console.cloud.google.com/apis/credentials/consent>`_. Log in with your *Google Workspace* with your *Google Workspace* account if you have one, otherwise log in with your personal Gmail
account if you have one, otherwise log in with your personal Gmail account (this should match the account (this should match the email address you want to configure in Odoo).
email address you want to configure in Odoo).
After that, click on :guilabel:`Create Project`, located on the far right of the OAuth consent After that, click on :guilabel:`Create Project`, located on the far right of the :guilabel:`OAuth
screen. If a project has already been created in this account, then the :guilabel:`New Project` consent screen`. If a project has already been created in this account, then the :guilabel:`New
option will be located on the top left under the :guilabel:`Select a project` drop-down menu. Project` option will be located on the top right under the :guilabel:`Select a project` drop-down
menu.
On the :guilabel:`New Project` screen, rename the :guilabel:`Project name` to `Odoo` and browse for On the :menuselection:`New Project` screen, rename the :guilabel:`Project name` to `Odoo` and
the :guilabel:`Location`. Set the :guilabel:`Location` as the `Google Workspace` organization. If browse for the :guilabel:`Location`. Set the :guilabel:`Location` as the *Google Workspace
you are using a personal Gmail account, then leave the :guilabel:`Location` as `No Organization`. organization*. If you are using a personal Gmail account, then leave the :guilabel:`Location` as
:guilabel:`No Organization`.
.. image:: google_oauth/new-project.png .. image:: google_oauth/new-project.png
:align: center :align: center
:alt: Project Name and Location for Google Oauth. :alt: Project Name and Location for Google OAuth.
Click on :guilabel:`Create` to finish this step. On the next screen, :guilabel:`User Type` options, Click on :guilabel:`Create` to finish this step.
select the :guilabel:`External` option, and then click on :guilabel:`Create` again, which will
finally navigate to the :guilabel:`Edit app registration` page. OAuth consent screen
--------------------
If the page doesn't redirect to the :menuselection:`User Type` options, click on :guilabel:`OAuth
consent screen` in the left menu.
Under :guilabel:`User Type` options, select the appropriate :guilabel:`User Type`, and then click on
:guilabel:`Create` again, which will finally navigate to the :menuselection:`Edit app registration`
page.
.. warning::
*Personal* Gmail Accounts are only allowed to be **External** User Type, which means Google may
require an approval, or for *Scopes* to be added on. However, using a *Google WorkSpace* account
allows for **Internal** User Type to be used.
Note, as well, that while the API connection is in the *External* testing mode, then no approval is
necessary from Google. User limits in this testing mode is set to 100 users.
Edit app registration Edit app registration
--------------------- ---------------------
- On the :guilabel:`Oauth consent screen` step, under the :guilabel:`App information` section, Next we will configure the app registration of the project.
enter `Odoo` in the :guilabel:`App name` field. Select the organization's email address under the
On the :guilabel:`OAuth consent screen` step, under the :guilabel:`App information` section, enter
`Odoo` in the :guilabel:`App name` field. Select the organization's email address under the
:guilabel:`User support` email field. :guilabel:`User support` email field.
- Next, under :menuselection:`App Domain --> Authorized domains`, click on :guilabel:`Add Domain`
and enter `odoo.com`. Next, under :menuselection:`App Domain --> Authorized domains`, click on :guilabel:`Add Domain` and
- After that, under the :guilabel:`Developer contact information` section, enter the organization's enter `odoo.com`.
email address. Google uses this email address to notify the organization about any changes to
your project. After that, under the :guilabel:`Developer contact information` section, enter the organization's
- Next, click on the :guilabel:`Save and Continue` button. email address. Google uses this email address to notify the organization about any changes to your
- Then, skip the :guilabel:`Scopes` page by scrolling to the bottom and clicking on project.
:guilabel:`Save and Continue`.
- Next, add the email being configured under the :guilabel:`Test users` step by clicking on Next, click on the :guilabel:`Save and Continue` button. Then, skip the :menuselection:`Scopes` page
:guilabel:`Add Users` and then the :guilabel:`Save and Continue` button. A summary of the by scrolling to the bottom and clicking on :guilabel:`Save and Continue`.
:guilabel:`App registration` appears.
- Finally, scroll to the bottom and click on :guilabel:`Back to Dashboard`. If continuing in testing mode (External), add the email addresses being configured under the
:guilabel:`Test users` step, by clicking on :guilabel:`Add Users`, and then the :guilabel:`Save and
Continue` button. A summary of the app registration appears.
Finally, scroll to the bottom and click on :guilabel:`Back to Dashboard` to finish setting up the
project.
Create Credentials Create Credentials
------------------ ------------------
Now that you have set up the project, you need to create credentials, which includes the Now that the project is set up, credentials should be created, which includes the *Client ID* and
:guilabel:`Client ID` and :guilabel:`Client Secret`. First, click on :guilabel:`Credentials` in the *Client Secret*. First, click on :guilabel:`Credentials` in the left sidebar menu.
left sidebar menu.
Then, click on :guilabel:`Create Credentials` in the top menu and select Then, click on :guilabel:`Create Credentials` in the top menu and select :guilabel:`OAuth client ID`
:guilabel:`OAuth client ID` from the dropdown menu. from the dropdown menu.
- Under :guilabel:`Application Type`, select :guilabel:`Web Application` from the dropdown menu. - Under :guilabel:`Application Type`, select :guilabel:`Web Application` from the dropdown menu.
- In the :guilabel:`Client ID` field, enter `Odoo`. - In the :guilabel:`Name` field, enter `Odoo`.
- Under the :guilabel:`Authorized redirect URIs` label, click the button :guilabel:`ADD URI`, and - Under the :guilabel:`Authorized redirect URIs` label, click the button :guilabel:`ADD URI`, and
then input `https://yourdbname.odoo.com/google_gmail/confirm` in the :guilabel:`URIs 1` field. Be then input `https://yourdbname.odoo.com/google_gmail/confirm` in the :guilabel:`URIs 1` field.
sure to replace the *yourdbname* part of the URL with your actual Odoo database name. Be sure to replace the *yourdbname* part of the URL with the actual Odoo database name.
- Next, click on :guilabel:`Create` to generate an OAuth :guilabel:`Client ID` and - Next, click on :guilabel:`Create` to generate an OAuth :guilabel:`Client ID` and :guilabel:`Client
:guilabel:`Client Secret`. Finally, copy each generated value for later use when configuring in Secret`. Finally, copy each generated value for later use when configuring in Odoo, and then
Odoo, and then navigate to the Odoo database. navigate to the Odoo database.
.. image:: google_oauth/client-credentials.png .. image:: google_oauth/client-credentials.png
:align: center :align: center
@ -91,32 +114,37 @@ Enter Google Credentials
------------------------ ------------------------
First, open Odoo and navigate to the :guilabel:`Apps` module. Then, remove the :guilabel:`Apps` First, open Odoo and navigate to the :guilabel:`Apps` module. Then, remove the :guilabel:`Apps`
filter from the search bar and type in `Google`. Install the module called :guilabel:`Google Gmail`. filter from the search bar and type in `Google`. Install the module called :guilabel:`Google
Gmail`.
Next, navigate to :menuselection:`Settings --> General Settings`, and under the :guilabel:`Discuss` Next, navigate to :menuselection:`Settings --> General Settings`, and under the :guilabel:`Discuss`
section, ensure that the checkbox for :guilabel:`Custom Email Servers` is checked. This populates a section, ensure that the checkbox for :guilabel:`Custom Email Servers` or :guilabel:`External Email
new option for :guilabel:`Gmail Credentials`. Then, copy and paste the :guilabel:`Client ID` and Servers` is checked. This populates a new option for :guilabel:`Gmail Credentials` or :guilabel:`Use
:guilabel:`Client Secret` into the respective fields and :guilabel:`Save` the settings. a Gmail Sever`. Then, copy and paste the respective values into the :guilabel:`Client ID` and
:guilabel:`Client Secret` fields and :guilabel:`Save` the settings.
Configure outgoing email server Configure outgoing email server
------------------------------- -------------------------------
After that, on the :guilabel:`General Settings` page, under :guilabel:`Custom Email Servers`, click To configure the external Gmail account, return to the top of the :guilabel:`Custom Email Servers`
:guilabel:`Outgoing Email Servers` to configure the external Gmail account. setting and then click the :guilabel:`Outgoing Email Servers` link.
.. image:: google_oauth/outgoing-servers.png .. image:: google_oauth/outgoing-servers.png
:align: center :align: center
:alt: Configure Outgoing Email Servers in Odoo. :alt: Configure Outgoing Email Servers in Odoo.
Then, :guilabel:`Create` a new email server and select the option for :guilabel:`Gmail`. Next, fill Then, click on :guilabel:`New` or :guilabel:`Create` to create a new email server, and fill in the
in the :guilabel:`Description` (can be anything) and the email :guilabel:`Username` and click on :guilabel:`Name`, :guilabel:`Description`, and the email :guilabel:`Username` (if required).
:guilabel:`Connect your Gmail account`.
A new window from :guilabel:`Google` opens to complete the authorization process. Select the Next, click on :guilabel:`Gmail OAuth Authentication` or :guilabel:`Gmail` (under the
:guilabel:`Authenticate with` or :guilabel:`Connection` section). Finally, click on
:guilabel:`Connect your Gmail Account`.
A new window labeled :guilabel:`Google` opens to complete the authorization process. Select the
appropriate email address that is being configured in Odoo. appropriate email address that is being configured in Odoo.
If the email address is a personal account, an extra step pops up, click :guilabel:`Continue` to If the email address is a personal account, then an extra step pops up, so click
allow the verification and connect the Gmail account to Odoo. :guilabel:`Continue` to allow the verification and connect the Gmail account to Odoo.
Then, allow Odoo to access the Google account by clicking on :guilabel:`Continue` or Then, allow Odoo to access the Google account by clicking on :guilabel:`Continue` or
:guilabel:`Allow`. After that, the page navigates back to the newly configured outgoing email :guilabel:`Allow`. After that, the page navigates back to the newly configured outgoing email
@ -127,9 +155,8 @@ server in Odoo. The configuration automatically loads the token in Odoo, and a t
:align: center :align: center
:alt: Configure Outgoing Email Servers in Odoo. :alt: Configure Outgoing Email Servers in Odoo.
Finally, save the settings and :guilabel:`Test the Connection`. A confirmation message should Finally, :guilabel:`Test the Connection`. A confirmation message should appear. The Odoo database
appear. The Odoo database can now send safe, secure emails through Google using OAuth can now send safe, secure emails through Google using OAuth authentication.
authentication.
Google OAuth FAQ Google OAuth FAQ
================ ================
@ -137,8 +164,8 @@ Google OAuth FAQ
Production VS Testing Publishing Status Production VS Testing Publishing Status
--------------------------------------- ---------------------------------------
Choosing :guilabel:`Production` as the :guilabel:`Publishing Status` (instead of Testing) will Choosing :guilabel:`Production` as the :guilabel:`Publishing Status` (instead of
display the following warning message: :guilabel:`Testing`) will display the following warning message:
.. image:: google_oauth/published-status.png .. image:: google_oauth/published-status.png
:align: center :align: center
@ -158,39 +185,35 @@ populate.
:align: center :align: center
:alt: 403 Access Denied Error. :alt: 403 Access Denied Error.
To correct this error, return to the :guilabel:`OAuth consent screen` under To correct this error, return to the :guilabel:`OAuth consent screen` under :guilabel:`APIs &
:guilabel:`APIs & Services` and add test user(s) to the app. Add the email that you are configuring Services` and add test user(s) to the app. Add the email that you are configuring in Odoo.
in Odoo.
Gmail Module not updated Gmail Module not updated
------------------------ ------------------------
If the :guilabel:`Gmail Module` in Odoo has not been updated to the latest version, then a If the *Google Gmail* module in Odoo has not been updated to the latest version, then a
:guilabel:`Forbidden` error message populates. :guilabel:`Forbidden` error message populates.
.. image:: google_oauth/forbidden-error.png .. image:: google_oauth/forbidden-error.png
:align: center :align: center
:alt: Forbidden you don't have the permission to access the requested resource. :alt: Forbidden you don't have the permission to access the requested resource.
To correct this error, go to the :guilabel:`Apps` module and clear out the search terms. Then, To correct this error, go to the :menuselection:`Apps` module and clear out the search terms. Then,
search for `Gmail` or `Google` and upgrade the :guilabel:`Google Gmail` module. Finally, click on search for `Gmail` or `Google` and upgrade the :guilabel:`Google Gmail` module. Finally, click
the three dots on the upper right of the module and select :guilabel:`Upgrade`. on the three dots on the upper right of the module and select :guilabel:`Upgrade`.
Application Type Application Type
---------------- ----------------
When creating the :guilabel:`Credentials` (OAuth Client ID and Client Secret), if When creating the credentials (OAuth *Client ID* and *Client Secret*), if :guilabel:`Desktop App` is
:guilabel:`Desktop App` is selected for the :guilabel:`Application Type`, an selected for the :guilabel:`Application Type`, an :guilabel:`Authorization Error` appears.
:guilabel:`Authorization Error` appears.
.. image:: google_oauth/error-400.png .. image:: google_oauth/error-400.png
:align: center :align: center
:alt: Error 400 Redirect URI Mismatch. :alt: Error 400 Redirect URI Mismatch.
To correct this error, delete the credentials already created and create new credentials, selecting To correct this error, delete the credentials already created and create new credentials, selecting
:guilabel:`Web Application` for the :guilabel:`Application Type`. Then, under :guilabel:`Web Application` for the :guilabel:`Application Type`. Then, under :guilabel:`Authorized
:guilabel:`Authorized redirect URIs`, click :guilabel:`ADD URI` and type: redirect URIs`, click :guilabel:`ADD URI` and type:
`https://yourdbname.odoo.com/google_gmail/confirm` in the field. `https://yourdbname.odoo.com/google_gmail/confirm` in the field, being sure to replace *yourdbname*
in the URL with the Odoo database name.
.. note::
Replace *yourdbname* in the URL with the Odoo database name.

View File

@ -2,14 +2,14 @@
Google Sign-In Authentication Google Sign-In Authentication
============================= =============================
The **Google Sign-In Authentication** is a useful function that allows your users to sign in to Odoo The *Google Sign-In Authentication* is a useful function that allows Odoo users to sign in to their
with their Google account. database with their Google account.
This is particularly helpful if your organization uses Google Workforce and you want the employees This is particularly helpful if the organization uses Google Workspace, and wants employees within
within your organization to connect to Odoo with their Google Accounts. the organization to connect to Odoo using their Google Accounts.
.. seealso:: .. seealso::
- :doc:`../../productivity/calendar/google` - :doc:`/applications/productivity/calendar/google`
- :doc:`/administration/maintain/google_oauth` - :doc:`/administration/maintain/google_oauth`
.. _google-sign-in/configuration: .. _google-sign-in/configuration:
@ -17,7 +17,7 @@ within your organization to connect to Odoo with their Google Accounts.
Configuration Configuration
============= =============
The integration of the Google sign-in function requires configuration both on Google and on Odoo. The integration of the Google sign-in function requires configuration both on Google *and* Odoo.
.. _google-sign-in/api: .. _google-sign-in/api:
@ -25,15 +25,16 @@ Google API Dashboard
-------------------- --------------------
#. Go to the `Google API Dashboard <https://console.developers.google.com/>`_. #. Go to the `Google API Dashboard <https://console.developers.google.com/>`_.
#. Make sure the right project is opened. If you don't have a project yet, click on *Create #. Make sure the right project is opened. If there isn't a project yet, click on :guilabel:`Create
Project*, fill out the project name and other details of your company, and click on *Create*. Project`, fill out the project name and other details of the company, and click on
:guilabel:`Create`.
.. image:: google/new-project-details.png .. image:: google/new-project-details.png
:align: center :align: center
:alt: Filling out the details of a new project :alt: Filling out the details of a new project.
.. tip:: .. tip::
Choose the name of your own company from the drop-down menu. Choose the name of the company from the drop-down menu.
.. _google-sign-in/oauth: .. _google-sign-in/oauth:
@ -44,16 +45,30 @@ OAuth consent screen
.. image:: google/consent-selection.png .. image:: google/consent-selection.png
:align: center :align: center
:alt: Google oauth consent selection menu :alt: Google OAuth consent selection menu.
#. Choose the option for :guilabel:`internal`, and click on :guilabel:`Create`. #. Choose one of the options (:guilabel:`Internal` / :guilabel:`External`), and click on
:guilabel:`Create`.
.. image:: google/consent.png .. image:: google/consent.png
:align: center :align: center
:alt: Choice of a user type in oauth consent :alt: Choice of a user type in OAuth consent.
#. Fill out your details and domain info, then click on *Save and Continue*. .. warning::
#. On the **Scopes** page, leave all fields as is, and click on *Save and Continue*. *Personal* Gmail Accounts are only allowed to be **External** User Type, which means Google
may require an approval, or for *Scopes* to be added on. However, using a *Google WorkSpace*
account allows for **Internal** User Type to be used.
Note, as well, that while the API connection is in the *External* testing mode, then no
approval is necessary from Google. User limits in this testing mode is set to 100 users.
#. Fill out the required details and domain info, then click on :guilabel:`Save and Continue`.
#. On the :menuselection:`Scopes` page, leave all fields as is, and click on :guilabel:`Save and
Continue`.
#. Next, if continuing in testing mode (*External*), add the email addresses being configured under
the :guilabel:`Test users` step by clicking on :guilabel:`Add Users`, and then the
:guilabel:`Save and Continue` button. A summary of the app registration appears.
#. Finally, scroll to the bottom, and click on :guilabel:`Back to Dashboard`.
.. _google-sign-in/credentials: .. _google-sign-in/credentials:
@ -64,24 +79,24 @@ Credentials
.. image:: google/credentials-button.png .. image:: google/credentials-button.png
:align: center :align: center
:alt: Credentials button menu :alt: Credentials button menu.
#. Click on *Create Credentials* and select **OAuth client ID**. #. Click on :guilabel:`Create Credentials`, and select :guilabel:`OAuth client ID`.
.. image:: google/client-id.png .. image:: google/client-id.png
:align: center :align: center
:alt: Oauth client id selection :alt: OAuth client id selection.
#. Select **Web Application** as the Application type. Now configure the allowed pages on which you #. Select :guilabel:`Web Application` as the :guilabel:`Application Type`. Now, configure the
will be redirected. allowed pages on which Odoo will be redirected.
In order to achieve this, in the **Authorized redirect URIs** field, enter your database's domain In order to achieve this, in the :guilabel:`Authorized redirect URIs` field, enter the database's
immediately followed by ``/auth_oauth/signin``. For example: domain immediately followed by `/auth_oauth/signin`. For example:
``https://mydomain.odoo.com/auth_oauth/signin``, then click on *Create*. `https://mydomain.odoo.com/auth_oauth/signin`, then click on :guilabel:`Create`.
.. image:: google/create-client-id.png #. Now that the *OAuth client* has been created, a screen will appear with the :guilabel:`Client ID`
:align: center and :guilabel:`Client Secret`. Copy the :guilabel:`Client ID` for later, as it will be necessary
:alt: Creating oauth client id for the configuration in Odoo, which will be covered in the following steps.
.. _google-sign-in/auth-odoo: .. _google-sign-in/auth-odoo:
@ -93,47 +108,53 @@ Google Authentication on Odoo
Retrieve the Client ID Retrieve the Client ID
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
Once you have done the previous steps, two keys are generated on the Google API Dashboard: *Client Once the previous steps are complete, two keys are generated on the Google API Dashboard:
ID* and *Client Secret*. Copy the *Client ID*. :guilabel:`Client ID` and :guilabel:`Client Secret`. Copy the :guilabel:`Client ID`.
.. image:: google/secret-ids.png .. image:: google/secret-ids.png
:align: center :align: center
:alt: Google OAuth Client ID generated :alt: Google OAuth Client ID generated.
.. _google-sign-in/odoo-activation: .. _google-sign-in/odoo-activation:
Odoo activation Odoo activation
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
#. Go to :menuselection:`Odoo General Settings --> Integrations` and activate **OAuth #. Go to :menuselection:`Odoo General Settings --> Integrations` and activate :guilabel:`OAuth
Authentication**. Authentication`.
.. note:: .. note::
You may have to log in again after this step. Odoo may prompt the user to log-in again after this step.
#. Go back to :menuselection:`General Settings --> Integrations`, activate **Google #. Go back to :menuselection:`General Settings --> Integrations --> OAuth Authentication`, activate
Authentication**, then fill out the *Client ID* with the key from the Google API Dashboard, and the selection and :guilabel:`Save`. Next, return to :menuselection:`General Settings -->
*Save*. Integrations --> Google Authentication` and activate the selection. Then fill out the
:guilabel:`Client ID` with the key from the Google API Dashboard, and :guilabel:`Save`.
.. image:: google/odoo-client-id.png .. image:: google/odoo-client-id.png
:align: center :align: center
:alt: Filling out the client id in Odoo settings :alt: Filling out the client id in Odoo settings.
.. note::
Google OAuth2 configuration can also be accessed by clicking on :guilabel:`OAuth Providers`
under the :guilabel:`OAuth Authentication` heading in :menuselection:`Integrations`.
.. _google-sign-in/log-in: .. _google-sign-in/log-in:
Log in to Odoo with Google Log in to Odoo with Google
========================== ==========================
To link your Google account to your Odoo profile, click on *Log in with Google* when you are asked To link the Google account to the Odoo profile, click on :guilabel:`Log in with Google` when first
to choose a new password. logging into Odoo.
.. image:: google/first-login.png .. image:: google/first-login.png
:align: center :align: center
:alt: Reset password screen with "Log in with Google" button :alt: Reset password screen with "Log in with Google" button.
Existing users must :ref:`reset their password <users/reset-password>` to access the *reset
password* page, while new users can directly click on *Log in with Google* instead of choosing a new Existing users must :ref:`reset their password <users/reset-password>` to access the
password. :menuselection:`Reset Password` page, while new users can directly click on :guilabel:`Log in with
Google`, instead of choosing a new password.
.. seealso:: .. seealso::
- `Google Cloud Platform Console Help - Setting up OAuth 2.0 - `Google Cloud Platform Console Help - Setting up OAuth 2.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -1,9 +1,9 @@
=============================== =====================================
Google Calendar synchronization Synchronize Google calendar with Odoo
=============================== =====================================
Synchronize Google Calendar with Odoo to see and manage meetings from both platforms (updates go Synchronize Google Calendar with Odoo to see and manage meetings from both platforms (updates go in
in both directions). This integration helps organize your schedule so you never miss a meeting. both directions). This integration helps organize schedules, so a meeting is never missed.
.. seealso:: .. seealso::
- :doc:`/applications/general/auth/google` - :doc:`/applications/general/auth/google`
@ -12,96 +12,100 @@ in both directions). This integration helps organize your schedule so you never
Setup in Google Setup in Google
=============== ===============
Enable Google Calendar API Select (or create) a project
-------------------------- ----------------------------
Begin by creating a new Google API project and enabling the Google Calendar API. Then, go to the Create a new Google API project and enable the Google Calendar API. First, go to the `Google API
`Google API Console <https://console.developers.google.com>`_ and log into your Google account. Console <https://console.developers.google.com>`_ and log into the Google account.
.. note:: .. note::
If this is your first time visiting this page, Google will prompt you to enter a country and 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 agree to the Terms of Service. Select a country from the drop-down list and agree to the
:abbr:`ToS (Terms of Service)`. :abbr:`ToS (Terms of Service)`.
Next, click :guilabel:`Select a project` and select or create an API project to store credentials. Next, click :guilabel:`Select a project` and select (or create) an API project to configure OAuth
in, and store credentials. Click :guilabel:`New Project`.
.. image:: google/new-api-project.png .. image:: google/new-api-project.png
:align: center :align: center
:alt: Create a new API project to store credentials. :alt: Create a new API project to store credentials.
.. tip:: .. tip::
Give the API Project a clear name like "Odoo Sync" so you can easily find it. Give the API Project a clear name, like "Odoo Sync", so it can be easily identified.
Then, open the API Project and click :guilabel:`Enable APIs and Services`. Enable Google calendar API
--------------------------
Now, click on :guilabel:`Enabled APIs and Services` in the left menu. Select :guilabel:`Enabled APIs
and Services` again if the :guilabel:`Search bar` doesn't appear.
.. image:: google/enable-apis-services.png .. image:: google/enable-apis-services.png
:align: center :align: center
:alt: Enable APIs and Services on the API Project. :alt: Enable APIs and Services on the API Project.
After that, search for *Google Calendar API* using the search bar and select :guilabel:`Google After that, search for `Google Calendar API` using the search bar and select :guilabel:`Google
Calendar API` from the search results. Click :guilabel:`Enable`. Calendar API` from the search results. Click :guilabel:`Enable`.
.. image:: google/enable-google-cal-api.png .. image:: google/enable-google-cal-api.png
:align: center :align: center
:alt: Enable the Google Calendar API. :alt: Enable the Google Calendar API.
OAuth consent screen
--------------------
Now that the API project has been created, OAuth should be configured. To do that, click on
:guilabel:`OAuth consent` in the left menu and then select the :guilabel:`User Type`.
.. warning::
*Personal* Gmail Accounts are only allowed to be **External** User Type, which means Google may
require an approval, or for *Scopes* to be added on. However, using a *Google WorkSpace* account
allows for **Internal** User Type to be used.
Note, as well, that while the API connection is in the *External* testing mode, then no approval is
necessary from Google. User limits in this testing mode is set to 100 users.
In the second step, :guilabel:`OAuth Consent Screen`, type `Odoo` in the :guilabel:`App name` field,
select the email address for the :guilabel:`User support email` field, and type the email address
for the :guilabel:`Developer contact information` section. Then, click :guilabel:`Save and
Continue`.
Skip the third step, :menuselection:`Scopes`, by clicking :guilabel:`Save and Continue`.
Next, if continuing in testing mode (External), add the email addresses being configured under the
:guilabel:`Test users` step, by clicking on :guilabel:`Add Users`, and then the :guilabel:`Save and
Continue` button. A summary of the app registration appears.
Finally, scroll to the bottom, and click on :guilabel:`Back to Dashboard`.
Now, the OAuth consent has been configured, and it's time to create credentials.
Create credentials Create credentials
------------------ ------------------
Now that you have created your API project and enabled the Google Calendar API, you need to create The *Client ID* and the *Client Secret* are both needed to connect Google Calendar to Odoo. This is
credentials. Begin by clicking :guilabel:`Create Credentials`. Google will then guide you through the last step in the Google console. Begin by clicking :guilabel:`Credentials` in the left menu.
four steps to create your API credentials. Then, click :guilabel:`Create Credentials`, and select :guilabel:`OAuth client ID`, Google will open
a guide to create credentials.
- In the first step, :guilabel:`Credential Type`, select the :guilabel:`Google Calendar API` and Under :menuselection:`Create OAuth Client ID`, select :guilabel:`Website application` for the
:guilabel:`User Data` options. Then, click :guilabel:`Next`. :guilabel:`Application Type` field, and type `My Odoo Database` for the :guilabel:`Name`.
.. image:: google/credential-type.png
:align: center
:alt: Select Google Calendar API and User Data for the Credential Type.
- In the second step, :guilabel:`OAuth Consent Screen`, type *Odoo* in the :guilabel:`App name`
field, select your email address for the :guilabel:`User support email` field, and type your email
address for the :guilabel:`Developer contact information` section. Then, click :guilabel:`Save
and Continue`.
- Skip the third step, :guilabel:`Scopes`, by clicking :guilabel:`Save and Continue`.
- In the last step, :guilabel:`OAuth Client ID`, select :guilabel:`Website application` for the
:guilabel:`Application Type` field and type *My Odoo Database* for the :guilabel:`Name`.
- Under the :guilabel:`Authorized JavaScript Origins` section, click :guilabel:`+ Add URI` and - Under the :guilabel:`Authorized JavaScript Origins` section, click :guilabel:`+ Add URI` and
type your company's Odoo URL address. type the company's Odoo full :abbr:`URL (Uniform Resource Locator)` address.
- Under the :guilabel:`Authorized redirect URIs` section, click :guilabel:`+ Add URI` and type - Under the :guilabel:`Authorized redirect URIs` section, click :guilabel:`+ Add URI` and type
your company's Odoo URL address followed by */google_account/authentication*. Finally, click the company's Odoo :abbr:`URL (Uniform Resource Locator)` address followed by
:guilabel:`Create` and :guilabel:`Done`. `/google_account/authentication`. Finally, click :guilabel:`Create`.
.. image:: google/uri.png .. image:: google/uri.png
:align: center :align: center
:alt: Add the authorized JavaScript origins and the authorized redirect URIs. :alt: Add the authorized JavaScript origins and the authorized redirect URIs.
After successfully creating a new API project, enabling the Google Calendar API, and generating the A :guilabel:`Client ID` and :guilabel:`Client Secret` will appear, copy these to a notepad.
Google Calendar API credentials, you should now have a Client ID and Client Secret.
Client ID & Client Secret
-------------------------
The **Client ID** and the **Client Secret** are both needed to connect Google Calendar to Odoo. Find
the Client ID and the Client Secret by opening the Google Cloud Platform navigation menu and going
to :menuselection:`API & Services --> Credentials --> OAuth 2.0 Client IDs`.
Next, locate the credentials you just created for the Google Calendar API. Then, click on
:guilabel:`Edit OAuth Client` (the pencil icon). The page will redirect to the edit page, where you
can view the Client ID and the Client Secret.
.. image:: google/edit-oauth-2.png
:align: center
:alt: Click Edit OAuth Client to view the credential details.
Setup in Odoo Setup in Odoo
============= =============
Once the Client ID and the Client Secret are located, open the Odoo database and go to Once the *Client ID* and the *Client Secret* are located, open the Odoo database and go to
:menuselection:`Settings --> General Settings --> Integrations --> Google Calendar`. Check the box :menuselection:`Settings --> General Settings --> Integrations --> Google Calendar`. Check the box
next to :guilabel:`Google Calendar`. next to :guilabel:`Google Calendar`.
@ -109,20 +113,25 @@ next to :guilabel:`Google Calendar`.
:align: center :align: center
:alt: The Google Calendar checkbox in General Settings. :alt: The Google Calendar checkbox in General Settings.
Next, copy and paste the Client ID and the Client Secret from the Google Calendar API Credentials Next, copy and paste the *Client ID* and the *Client Secret* from the Google Calendar API
page into their respective fields below the :guilabel:`Google Calendar` checkbox. Then, click credentials page into their respective fields below the :guilabel:`Google Calendar` checkbox. Then,
:guilabel:`Save`. click :guilabel:`Save`.
Finally, open the Calendar module in Odoo and click on the :guilabel:`Google` sync button to sync Sync calendar in Odoo
Google Calendar with Odoo. =====================
Finally, open the :menuselection:`Calendar` app in Odoo and click on the :guilabel:`Google` sync
button to sync Google Calendar with Odoo.
.. image:: google/sync-google.png .. image:: google/sync-google.png
:align: center :align: center
:alt: Click the Google sync button in Odoo Calendar to sync Google Calendar with Odoo. :alt: Click the Google sync button in Odoo Calendar to sync Google Calendar with Odoo.
.. note:: .. note::
The first time you sync your Google Calendar with Odoo, the page will redirect to your Google When syncing Google Calendar with Odoo for the first time, the page will redirect to the Google
Account. Click :guilabel:`OK` and :guilabel:`Allow` to authorize Odoo to access Google Calendar. Account. From there, select the :guilabel:`Email Account` that should have access, then select
:guilabel:`Continue` (should the app be unverifed), and finally select :guilabel:`Continue` (to
give permission for the transfer of data)`.
.. image:: google/trust-odoo.png .. image:: google/trust-odoo.png
:align: center :align: center
@ -130,6 +139,17 @@ Google Calendar with Odoo.
Now, Odoo Calendar is successfully synced with Google Calendar! Now, Odoo Calendar is successfully synced with Google Calendar!
.. image:: google/successful-sync.png .. warning::
:align: center Odoo highly recommends testing the Google calendar synchronization on a test database and a test
:alt: Successfully sync between Odoo and Google Calendar. 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
:guilabel:`Don't Send` when prompted to send invitation emails.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 65 KiB