Connect OneDrive¶
OneDrive uses OAuth2 sign-in. You first register an app in Microsoft Entra, then connect it from Odoo with one click.
Step 1: Register an app in Microsoft Entra¶
Sign in to the Microsoft Entra admin center and browse to .
Give the app a name (e.g.
Odoo Cloud Documents).Under Supported account types, choose who can use the app.
Under Redirect URI, choose the
Webplatform. You fill in the value itself in Step 3.Select Register. The app’s own Overview page opens. Copy the Application (client) ID and the Directory (tenant) ID from there.
Open , create a secret and copy its Value right away. It is shown only once.
Open and add:
offline_access, Files.ReadWrite.All, User.Read
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¶
Navigate to and click New.
Set a friendly Name (e.g.
OneDrive) and chooseOneDriveas the Provider Type.Open the Credentials tab and fill in:
Directory (Tenant) ID: the tenant ID from Step 1.
Client ID: the Application (client) ID from Step 1.
Client Secret: the secret Value from Step 1.
Save the record. The status bar stays on Not Connected until you finish Step 4.
Step 3: Redirect URI¶
Copy the Redirect URI from the provider form with the clipboard icon.
In your app registration under , add it as a
Webplatform redirect URI 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¶
On the Credentials tab, click Generate Access Token. Odoo saves the Client ID and Client Secret, then sends you to the Microsoft sign-in page.
Sign in with the Microsoft account whose OneDrive you want to connect, then review the permissions and click Accept.
Microsoft sends you back to the provider form and Odoo stores the access token. The Connect and Test Connection buttons now appear in the header.
Click Test Connection and verify that the success message appears.
Click Connect to activate the provider. The status moves from Not Connected to Connected.
Note
Access tokens are renewed automatically. You only need to reconnect if you revoke the app access in Microsoft or change the Client ID or Client Secret in Odoo.
Step 5: Webhook Configurations¶
What webhooks do
Webhooks allow OneDrive 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
Open your OneDrive provider.
Open the Webhook tab.
Enable Active on the event lines you want, and save.
Webhook Event Types¶
Create/Update Record
Triggered when a file or folder is added or modified in OneDrive.
Odoo automatically creates or updates the matching document or directory.
Delete Record
Triggered when a file or folder is deleted in OneDrive.
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.
See also