Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Discuss (mail)
• Project (project) |
Community Apps Dependencies | Show |
Lines of code | 2477 |
Technical Name |
hd_gchat_project |
License | OPL-1 |
Versions | 16.0 17.0 18.0 |
Google Chat Integration for Projects & Tasks
Seamlessly integrate your Odoo projects and tasks with Google Chat and Google Tasks. This module enables two-directional synchronization of projects, tasks, followers, messages, attachments, and reactions.
Enjoy simplified configuration with built-in Google Workspace Events subscriptions management.
Main features:
- Create a new Google Chat space for Odoo project.
- Import an existing Google Chat space for use with Odoo project.
- Auto-create and sync personal Google Tasks for each Odoo task assignee.
- Quickly create Odoo tasks directly from Google Chat.
-
Two-way synchronization of members, messages, attachments and reactions.
Works with both
project.project
andproject.task
models. Project task messages appear in the new thread. - Available for both Google Workspace and external users.
Demo:

Google Cloud console project setup
1. Create a Google API project.
Go to Google API Console (https://console.developers.google.com
) and log into the Google account.
Next, click Select a project and select (or create) an API project. Click New Project.

Give the API project a clear name, like Odoo Google Chat Sync
, so it can be identified. Then click the Create button.
2. Enable Required APIs
Now go to Menu ☰ > APIs & Services > Enabled APIs and Services. Select Enabled APIs and Services again if the Search bar doesn't appear.

After that, search for Google Chat API
using the search bar
and select Google Chat API from the search results. Click Enable.
Repeat this step for the following APIs:
- Google Tasks API
- Google Workspace Events API
- Cloud Pub/Sub API
- Admin SDK API
- Google People API
3. Set up a service account in Google Cloud console
Create a service account
- In the Google Cloud console, go to Menu ☰ > IAM & Admin > Service Accounts.
- Click Create service account.
- Fill in the service account name, then click Create and continue.
- Click Continue.
- Click Done.
Create a private key
- Select the created service account from the previous step.
- Click Keys > Add key > Create new key.
- Select JSON, then click Create. Your new public/private key pair is generated and downloaded to your machine as a new file. We'll use it in the next steps.
- Click Close.
Authenticate and authorize using domain-wide delegation
This step enhances usability for Google Workspace users as they don't need to manually sign in to OAuth.
In order for service user to perform actions on users behalf, we need to grant domain-wide delegation of authority.
-
Sign in to
https://admin.google.com
with a super administrator account to the Google Admin console.
If you aren't using a super administrator account, you can't complete these steps. - In the Admin console, go to Menu ☰ > Security > Access and data control > API controls > Manage Domain Wide Delegation.
- Click Add new.
- Enter the service account Client ID. (You can find it by this path: IAM & Admin > Service accounts > [name of your service account] > Expand Advanced settings > Copy the Client ID.)
-
In OAuth Scopes, add each scope from the following list:
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.messages
https://www.googleapis.com/auth/tasks
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
-
Click Authorize.
Note: If Multi-party approval (https://support.google.com/a/answer/13790448
) is enabled for your organization, authorizing domain-wide delegation for a client app requires approval from another super admin.
4. Set up Google Pub/Sub service
Create Google Pub/Sub topic
- In the Google Cloud console, go to the Pub/Sub Topics page (
https://console.cloud.google.com/cloudpubsub/topic
). - Click Create topic.
- In the Topic ID field, enter an ID for your topic.
- Discard the option Add a default subscription! We'll create subscription manually.
- Click Create.
Connect Google Chat API with Pub/Sub topic
- Go to Menu ☰ > APIs & Services > Enabled APIs and Services. Select Google Chat API.
- Select Configuration page.
-
Under Application info specify App name, like
Odoo
. It would be displayed around Google Chat messages coming from Odoo.
For Avatar URL you can use Odoo icon (https://cdn4.iconfinder.com/data/icons/logos-3/640/odoo_logo_rgb-256.png
).
For Description field type any description (e.g.Odoo Integration with Google Chat
). - Under Interactive features turn off Enable Interactive features.
- Under Logs, select Log errors to Logging.
- Click Save.
Grant Chat permission to publish to the topic
-
Now go back inside the topic. On the right panel in the Permissions tab click Add Principal button.
- In the Add principals field enter the following service account:
chat-api-push@system.gserviceaccount.com
-
For the Assign roles select Pub/Sub > Pub/Sub Publisher.
- Click Save.
Create Google Pub/Sub subscription
-
In the Subscriptions page click Create subscription.
- For the Subscription ID field, enter a name.
- Retain the Delivery type as Pull
-
For the Retry policy select Retry after exponential backoff delay option and leave default values for min/max backoff.
- Click Create.
Grant access to the subscription for service account
- Inside the subscription, on the right panel, go to Permissions tab > Click Add Principal button.
- In the Add principals field enter your service account email. (You can find it by this path: Menu ☰ > IAM & Admin > Service accounts > [name of your service account] > Email.)
- For the Assign roles select Pub/Sub > Pub/Sub Subscriber.
- Click Save.
5. Set up Google OAuth 2.0
This step is required for non-Workspace users.
You can skip it if all the users belong to the same Google Workspace organization.
OAuth consent screen
Click on APIs & Services > OAuth consent screen in the left menu, then click the Get started button.
Note: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.
Follow the proceeding steps, in order:
-
In App Information, type
Odoo
in the App name field, then enter the email address for the User support email field and click the Next button. - In Audience, select External, then click the Next button.
- In Contact Information, enter the email again, then click the Next button.
- In Finish, tick the checkbox to agree to Google API Services: User Policy. For the last step, click the Create button.
Authorized domain setup
Next, any domains set to appear on the consent screen or in an OAuth client's configuration must be pre-registered.
To do so, navigate to Branding in the left menu. In the Authorized domains section,
click the Add domain button to create a field to enter an authorized domain.
Enter a domain, such as odoo.com
, then click the Save button at the bottom of the page.
Test users
To give users the ability to sync with personal Gmail accounts, they must be set as a test user. Setup test users by going to Audience in the left-side menu and clicking the Add users button in the Test users section. Enter any desired user emails, and click the Save button.
Create credentials
- 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.

Setup in Odoo
Create Google Chat client
-
Go to Settings > Google Chat > Google Chat Client
-
For "Google Pub/Sub Topic Name" go to Pub/Sub > Topics > [name of your topic] > Copy Topic name.
-
For the field Admin User Email enter email of your Google Workspace user, who has access to Google Admin Console. This email address is used to perform requests to Google Directory API in order to map Odoo users with their Google ID. It can be any active account of the real person.
-
For Service Account Credentials enter the content of the .json file, which was downloaded to your computer in the step 3 of Google Setup.
-
Save the current record and click Sync All Workspace Users button.
Note:
In some cases, you may want to exclude specific users from synchronization with Google Workspace. To do this, go to the Settings menu, open the User form, navigate to the Google Chat tab, and uncheck the Enable Google Workspace Sync option.
Connect OAuth 2.0 Client (for external users)
Go to Settings > Google Chat to find Google Chat OAuth feature. Copy and paste the Client ID and the Client Secret (from the step 5 in Google Setup) into their respective fields. Then, click Save.

Users can sign in using one of the following methods:
-
Navigate to My Profile > Google Chat and click the Authenticate button.
-
Open a project that is already synced with Google Chat, then click Authenticate to Google Chat.
After that, users will be redirected to the OAuth consent screen, where they must grant the required permissions.

Manage events subscriptions
Events subscriptions are applied for a single member per Google Chat. They're created and renewed automatically. Manage them manually only in very occasional cases.
You can view all current subscriptions from the Google Chat Client form. There are Renew and Delete options for each subscription.

You also have an option to cancel/create subscription directly from the project record.


Start event listener
- Install docker on the target machine.
-
Pull docker image:
docker pull danproshyn/odoo-gchat-listener
- Copy service account credentials file (from the step 3 in Google Setup) to the machine.
-
Create and run docker container.
- Replace {path_to_credentials} with the location of the credentials file.
- Replace {pub_sub_subscription_name} with the name of your Pub/Sub subscription. For this go to Pub/Sub > Subscriptions > [name of your subscription] > Copy Subscription name.
-
Specify your real Odoo server configuration: host, port, database name.
We also strongly advice to change the default password of the Odoo service user (gchat_event_sender) and replace it in this command.
docker run --name odoo-gchat -d -v {path_to_credentials}:/usr/src/app/credentials.json \ -e GOOGLE_APPLICATION_CREDENTIALS=/usr/src/app/credentials.json \ -e GOOGLE_PUB_SUB_SUBSCRIPTION_NAME={pub_sub_subscription_name} \ -e ODOO_HOST=localhost \ -e ODOO_PORT=8069 \ -e ODOO_DBNAME=odoo \ -e ODOO_LOGIN=gchat_event_sender \ -e ODOO_PASSWORD=gchat_event_sender \ danproshyn/odoo-gchat-listener
Usage
Synchronizing Odoo project with Google Chat
Go to the Google Chat page inside the project and click Sync with Google Chat button.

You will have 2 options:
- Create a new Google Chat - Choose whether to allow external (non-Workspace) users to join. You can also enable to send existing messages from the Odoo project or tasks to Google Chat.
- Link an existing Google Chat - Provide the Google Chat ID and optionally select whether to sync existing messages from Google Chat to the Odoo project.


You can find Chat ID in the Google Chat URL.

After synchronization, you will see info about the linked Google Chat.

To stop syncing, uncheck Enable Sync in the Odoo project and click Cancel Events Subscription button.
To disable Google Chat integration, click Unbind Google Chat.
Synchronizing Odoo project tasks with Google Tasks
Tasks created from Odoo
Creating a task in Odoo triggers a message in the Google Chat. It contains all task details which are updated as the task changes. The task conversation is placed in a separate thread under this message.


Each task user receives a personal Google task, which is updated whenever the Odoo task changes. Completing the task in Odoo also marks all associated Google Tasks as completed.

Tasks created from Google Chat
When you create a task in Google Chat, it is immediately created in Odoo with the specified name, description, date, and assignee.


After creating a task, you can change the assignee in Google Chat, and the update will be reflected in Odoo. You can configure whether to add a new user to the task or replace the previous assignee.

Related modules
Author
Email: danpr080704@gmail.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module