| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 408 |
| Technical Name |
odoo_onedrive_connector |
| License | AGPL-3 |
Microsoft OneDrive Integration for Odoo 18
Enterprise-Grade Automatic Cloud File Synchronization
— Crafted by Jagadish Magesh
Overview
This module integrates Odoo with Microsoft OneDrive to automatically upload attachments from any Odoo model to cloud storage. Each user can securely connect their own OneDrive account using OAuth2 authentication.
- Automatic cloud backup
- Secure document storage
- Centralized file management
- Enterprise-ready architecture
- Zero manual upload effort
Key Features
Automatic Upload
- Files uploaded instantly when attachments are created
- Works with all Odoo models
- No manual action required
Multi-User Support
- Each user can connect their own OneDrive account
- Separate configuration per user
- Secure access isolation
Large File Support
- Supports files greater than 4MB
- Uses upload session mechanism
- Reliable enterprise file transfer
Architecture Diagram
| Odoo User |
+----------+----------+
|
v
+---------------------+
| Odoo Attachment |
+----------+----------+
v
+---------------------+
| OneDrive Module |
+----------+----------+
v
+---------------------+
| Microsoft Graph API |
+----------+----------+
v
+---------------------+
| OneDrive |
+---------------------+
Sequence Flow Diagram
|
v
Odoo creates attachment
|
v
Check OneDrive configuration
|
v
Validate access token
|
v
Upload file to OneDrive
|
v
Save upload history
Deployment Checklist
- Register application in Azure Portal
- Configure Redirect URI
- Add Microsoft Graph permissions
- Generate client secret
- Install Odoo module
- Create OneDrive configuration
- Assign configuration to user
- Upload test attachment
Performance Considerations
- Large files handled using upload sessions
- Automatic token refresh prevents failures
- Timeout protection implemented
- Minimal performance impact on Odoo
- Designed for enterprise scalability
Benefits
- Automatic cloud backup
- No manual upload required
- Secure document storage
- Centralized file management
- Multi-user support
- Enterprise-ready solution
- Reliable file synchronization
- Full upload tracking and monitoring
How This Module Works
This module automatically sends attachments from Odoo to Microsoft OneDrive. When a user uploads any file (invoice, sale order, purchase order, HR document, etc.), the system checks whether that user has a configured OneDrive account. If the configuration exists and the connection is active, the file is securely uploaded to the configured OneDrive folder using Microsoft Graph API.
- User uploads attachment in any Odoo model
- System detects attachment creation
- System checks user OneDrive configuration
- System validates access token
- File is uploaded to configured OneDrive folder
- Upload status is saved in history log
Screenshots
Complete Step-by-Step Configuration
Step 1: Register Application in Azure Portal
- Login to Microsoft Azure Portal
- Navigate to Azure Active Directory
- Open App Registrations
- Click New Registration
- Enter application name
- Select account type
- Register the application
Step 2: Configure Redirect URI
- Go to Authentication section
- Add Redirect URI
- Redirect URI must be:
Step 3: Create Client Secret
- Go to Certificates & Secrets
- Click New Client Secret
- Copy the Secret VALUE
- Do NOT use Secret ID
Step 4: Configure API Permissions
- Open API Permissions
- Add Microsoft Graph Permissions
- Required permissions:
Step 5: Configure in Odoo
- Go to Settings
- Navigate to Technical
- Open OneDrive Configuration
- Create new configuration record
- Select the Responsible user
- Enter Tenant ID
- Enter Client ID
- Enter Client Secret
Step 6: Get Authorization Code
- Click Get Code button
- Login to Microsoft account, Select OneDrive user So You will Get Code , access for Selected User Drive,
- Grant permissions
- it will Generate the Code , Copy authorization code
- Paste code into Odoo
Step 7: Get Access Token
- Click Get Token button
- System generates access token
- System generates refresh token
- System sets token expiry
Step 8: Configure Drive and Folder
- Click Get User ID
- Copy returned User ID
- Enter folder name
- Click Check Folders
- Copy driveId
- Copy Folder: ID
- Save configuration
- After configuration Make Sure that In Appropirate User Form View In Account Security Tab OneDrive Configuration is Setuped With Correct User
Usage Flow
Daily User Workflow
- User creates record (Invoice, Sale Order, Purchase Order, Employee Document, etc.)
- User uploads attachment
- System automatically uploads file to OneDrive
- Upload status recorded in history
- User continues normal workflow
How to Configure Multiple Users (Important)
This module supports multiple users, and each user can connect their own Microsoft OneDrive account independently. The configuration is performed once per user. The system will automatically upload attachments to the OneDrive account that is linked to the user who created or uploaded the attachment.
Step-by-Step: Configure OneDrive for Multiple Users
- Create a separate OneDrive configuration record for each user. Do not share the same configuration between users unless they are intentionally using the same OneDrive account.
- Open Odoo and go to Settings → Technical → OneDrive Configuration.
- Click Create to create a new configuration.
- Select the Responsible User. This user will be linked to this OneDrive account.
- Enter the Tenant ID, Client ID, and Client Secret from the Azure application.
- Click Get Code and log in using the Microsoft account that belongs to this specific user.
- After authorization, copy the generated authorization code and paste it into the configuration.
- Click Get Token to generate the Access Token and Refresh Token.
- Click Get User ID to retrieve the Microsoft user identifier.
- Specify the target folder name where files will be uploaded in OneDrive.
- Click Check Folders to automatically fetch the Drive ID and Folder ID.
- Click Save to complete the configuration for this user.
Important Validation Step
- Open the User Form in Odoo.
- Navigate to the Account Security tab.
- Ensure the correct OneDrive Configuration is assigned to the user.
- Repeat the same configuration process for every additional user who needs OneDrive integration.
Example Scenario
- User A uploads an invoice attachment → File is uploaded to User A OneDrive.
- User B uploads a purchase document → File is uploaded to User B OneDrive.
- Each user maintains independent storage, permissions, and audit history.
Please log in to comment on this module