Connect Google Drive

Google Drive uses OAuth2 sign-in. You first create an OAuth client in the Google Cloud Console, then connect from Odoo with one click.

Step 1: Create an OAuth client in the Google Cloud Console

  1. Go to the Google Cloud Console and create (or select) a project.

  2. Open APIs & Services ‣ Library, search for Google Drive API and click Enable.

    Google Drive API enabled in the Google Cloud Console
  3. Open Google Auth Platform ‣ Branding and fill in the app name, the user support email, and the developer contact email.

    App name and support email on the Google Auth Platform Branding page
  4. Open Google Auth Platform ‣ Audience and add the Google account you will connect from Odoo under Test users, otherwise Google blocks the sign-in in Step 4.

    Test users on the Google Auth Platform Audience page
  5. Open Google Auth Platform ‣ Data Access, click Add or remove scopes and add the following scope:

    https://www.googleapis.com/auth/drive
    

    Warning

    Enable all the scopes above. If you add one later, click Generate Access Token again to re-approve the app.

    Google Drive scope selected on the Data Access page
  6. Open Google Auth Platform ‣ Clients, click Create client and choose Web application:

    • Leave the Authorised redirect URIs field for now. You fill it in in Step 3.

    • Click Create, then copy the Client ID and Client Secret.

OAuth client with the Client ID and Client secret

Tip

The Required Permissions field shows the permissions needed. If any permission is missing after sign-in, the provider will not connect.

Step 2: Create the provider in Odoo

  1. Navigate to Cloud Storage ‣ Configuration ‣ Connections ‣ Providers and click New.

  2. Set a friendly Name (e.g. Company Drive) and choose Google Drive as the Provider Type.

  3. Open the Credentials tab and fill in the Client ID and Client Secret from Step 1.

  4. Save the record. The status bar stays on Not Connected until you finish Step 4.

Step 3: Redirect URI

Authorised redirect URIs on the OAuth client
  1. Copy the Redirect URI from the provider form with the clipboard icon.

  2. In your OAuth client under Google Auth Platform ‣ Clients, paste it into Authorised redirect URIs and click Save.

Warning

Paste the exact value, with no trailing slash, before Step 4. A mismatch is the most common cause of a failed sign-in.

Step 4: Connect and test

  1. On the Credentials tab, click Generate Access Token. Odoo saves the Client ID and Client Secret, then sends you to the Google sign-in page.

    Generate Access Token on the Credentials tab of the Google Drive provider
  2. Sign in with the Google account whose Drive you want to connect.

    Google account chooser during the Drive sign-in
  3. If Google shows a Google hasn’t verified this app screen, click Advanced, then Go to <your app name> (unsafe).

    Google warning that the app is not verified, with Continue
  4. Review the permissions and click Continue.

    Google permission request with the Continue button
  5. Google sends you back to the provider form and Odoo stores the access token. The Connect and Test Connection buttons now appear in the header.

    Connect and Test Connection buttons on the Google Drive provider form
  6. Click Test Connection and verify that the success message appears.

  7. Click Connect to activate the provider. The status moves from Not Connected to Connected.

    Connected Google Drive provider in Odoo showing the storage gauge

Note

Access tokens are renewed automatically. You only need to reconnect if you revoke the app access in Google or change the Client ID or Client Secret in Odoo.

Step 5: Webhook Configurations

  • What webhooks do

    • Webhooks allow Google Drive to instantly inform Odoo when something happens in your drive (a file or folder added, renamed, moved, or deleted).

    • This means Odoo updates automatically without waiting for the scheduled actions.

    • It helps keep your documents in sync in real time.

  • How to enable or disable

    1. Open your Google Drive provider.

    2. Open the Webhook tab.

    3. Enable Active on the event lines you want, and save.

Google Drive webhook events on the provider form

Webhook Event Types

  • Create/Update Record

    • Triggered when a file or folder is added or modified in Google Drive.

    • Odoo automatically creates or updates the matching document or directory.

  • Delete Record

    • Triggered when a file or folder is deleted in Google Drive.

    • Odoo removes the matching document or directory.

Note

  • Your Odoo URL must use https://. Webhooks will not work on localhost or an intranet.

  • The provider must be in Connected state.