Connecting Odoo to OneDrive
Link Odoo to Microsoft OneDrive through an Azure app registration so documents are saved automatically in OneDrive folders.

Benefits
Files are stored in OneDrive and not on the Odoo server.
Folders are organised automatically by module and record.
Files are accessible from Microsoft tools outside Odoo.
Access is controlled through scoped permissions.
Easy to follow guide
Register an app in Azure.
In the Azure Portal, open App registrations and click New registration.
Enter a name and choose supported account types. A redirect URI is optional.
You are registering Odoo with Microsoft as a known visitor.


Collect the credentials.
Note the Application (client) ID and the Directory (tenant) ID.
Under Client credentials, create a client secret. It is shown once, so save it immediately.


These are Odoo's username and password for Microsoft. Microsoft recommends a certificate for higher assurance.

Add scopes.
Under Expose an API, set the Application ID URI and add offline_access, openid and Files.ReadWrite.All.

offline_access provides a refresh token so the connection persists.
Files.ReadWrite.All allows reading and writing files.
openid handles sign-in.
Scopes limit what Odoo can do on OneDrive.
Set the web base URL in Odoo.
Go to Settings > Technical > System Parameters and set web.base.url.

Microsoft sends the user back to this address after login, so it must be correct.
Enter the settings in Odoo.
Go to Settings > General Settings > Integrations > Microsoft OneDrive and tick "Synchronize with OneDrive".
Fill in Client ID, Tenant ID, Client Secret, Setup Token and Folder Name.

This is where you give Odoo the keys it got from Azure.
Check the folder structure.
Files follow: Main Module Folder → Record Folder → Files.
For example, a Sales Order folder contains one folder per record (such as SO2610/0001), and the files sit inside it.

It works like a filing cabinet with one drawer per module and one folder per record.
Conclusion
With Odoo, attachments on each record sync to a matching OneDrive folder. Once the Azure app and the Odoo settings are in place, nobody has to move files between the two systems by hand.



Comments