How to connect Odoo with Google Bigquery

Google BigQuery Connector for Odoo Installation and Setup Guide


Watch Demo

Requirements:

  • Odoo Versions Supported: 12, 13, 14, 15, 16, 17 (Enterprise or Community)
  • Google Cloud Account with BigQuery enabled
  • Necessary permissions in Odoo and Google Cloud (follow along for more details)
  • The module depends on these python libraries 'google-cloud-bigquery', 'pandas','pyarrow'.
  • If you are on Odoo Sh, add these in your addons repository level requirements.txt.
  • If you are on on-premises server, install these manually in your Odoo python environment manually and restart the server.

Installation:

Configuration:

3.1. Obtaining BigQuery Project ID and Dataset ID:

  • Log in to your Google Cloud Console
  • Navigate to the BigQuery section.
  • Create a new project (if not already done). Note: Ensure the Project ID does not contain dots (".") as this may cause issues with certain integrations.
  • Note down the Project ID.
  • odoo-apps
  • In the BigQuery dashboard, create a new dataset. Remember: The Dataset ID should not contain dots (".") as well.
  • odoo-apps
  • Note down the Dataset ID.
  • odoo-apps

3.2. Creating a Google Cloud Service Account and Generating Credentials JSON:

  • Navigate to ‘IAM & Admin’ → ‘Service Accounts’ in the Google Cloud Console.
  • odoo-apps
  • Create a new service account and assign the ‘BigQuery Admin’ role for full BigQuery access. (if you do not want to give admin access provide “BigQueryData Editor” and “BigQuery Job User” role)
  • odoo-apps
  • Generate a new JSON key for this service account and download it. (Select your Service account and in “Keys” tab click “ADD KEY”)
  • odoo-apps

Connecting to Google BigQuery:

After configuring the BigQuery Connector in your Odoo settings, the next step is to ensure that it is properly connected and can communicate with Google BigQuery. Here’s how you can verify the connection:

  • Fill in the Required Information: In the Odoo settings menu, input the necessary details:
    • In Odoo, enter the BigQuery Project ID and Dataset ID in the connector settings.
    • odoo-apps
    • Paste the contents of the JSON file (download after key creation) into the ‘BigQuery Credentials JSON’ field. Click “SAVE” after filling information.
    • odoo-apps
  • Export Data to Verify Connection:
    • Navigate to the top menu in the settings and select a table to export from the dropdown list.
    • odoo-appsodoo-apps
    • Click the ‘Export’ button to initiate data export to BigQuery.
    • odoo-apps
    • This action will attempt to export the selected table's data to your BigQuery dataset.
  • Check BigQuery for Exported Data:
    • Log into your Google Cloud Console and go to the BigQuery section.
    • Navigate to the dataset you provided in the settings.
    • Check for the presence of the exported table and its data. (You might need to refresh the content to see the table(s) )
    • odoo-apps
    • Successful data (schema and records) visibility in the BigQuery dataset confirms that the connection between Odoo and BigQuery is functioning correctly.

Note: This process not only verifies the connection but also ensures that the BigQuery Connector is set up correctly and has the necessary permissions to perform data operations.

TechFinna

© 2024 TechFinna. All Rights Reserved.

TechFinna Private Limited #info@techfinna.com