OdooWiki OCA HUB

Microsoft account for Drive

microsoft_drive_account folder_open OCA/storage open_in_new
Uncategorised License: LGPL-3

This addon allows the user to link their Microsoft Drive account to Odoo. The stored credentials are then used by other addons to perform actions on Drive as the logged-in user.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets each Odoo user link their own Microsoft Drive (OneDrive) account to Odoo, so other apps can act on Drive on their behalf. Administrators configure the Microsoft app credentials and users connect or disconnect from their profile.

This module adds a Drive section to the user profile so each person can connect their own Microsoft Drive account to Odoo. On the user form (and on the simplified 'My Profile' form) a Drive block shows a connection button with a status of Connected or Not connected, plus a short message telling the user to click to connect or to disconnect/reset.

  • Clicking connect sends the user to Microsoft to authorise access; after approval the tokens are stored on the user record and the status becomes Connected.
  • Clicking disconnect opens a small confirmation wizard ('Reset Outlook Drive Account?') and, once confirmed, clears the stored tokens so the account is no longer linked.
  • Administrators can enter the Microsoft Drive Client ID, Client key and Scope in the general settings; the scope defaults to offline access plus file and site read/write permissions, and offline access and openid are always added if missing.
  • A non-interactive option lets a user be authenticated directly with client credentials instead of the interactive Microsoft login.

Technically it extends res.users (storing refresh token, access token, token validity and connection status), res.config.settings, the shared microsoft.service (Drive-specific scope and token handling) and adds a reset wizard model microsoft.drive.account.reset. Tokens are restricted to system administrators.

Depends on

microsoft_account

Required by other modules

Models and fields (4)
  • res.users · extends an existing modelmicrosoft_drive_token, microsoft_drive_rtoken (Microsoft Drive Refresh Token), microsoft_drive_status, microsoft_drive_token_validity, microsoft_drive_oauth2_non_interactive (Microsoft Drive OAuth2 (non-interactive))
  • microsoft.service · extends an existing model
  • res.config.settings · extends an existing modeldrive_microsoft_client_id (Microsoft Drive Client_id), drive_microsoft_client_scope (Microsoft Drive Scope), drive_microsoft_client_secret (Microsoft Drive Client_key)
  • microsoft.drive.account.reset · new modeluser_id

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 18.0

In order to use the Microsoft Drive Account module, you need to follow this process for link Odoo and Microsoft:

PART 1 : Create an Azure Application

To allow Odoo to access Microsoft OneDrive or SharePoint through the Microsoft Graph API, you must create an application in Azure Active Directory.

Step 1 – Open the Azure portal and go to Azure Active Directory, then "App registrations", and click “New registration”.

Step 2 – Register the application. Set a name “Odoo storage integration”. Select the third option "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)" Add a Redirect URI of type "Web". {URL of your Odoo instance}/microsoft_account/authentication. Once the application is created, note the Application (client) ID and the Directory (tenant) ID.

Step 3 – Generate a client secret. Go to Certificates & secrets, create a new client secret (Description : Odoo storage secret / Expires : 24month), and copy its value. You will not be able to see it again.

Step 4 – Configure API permissions. Open API permissions, add Microsoft Graph "Application permissions", and include Files.ReadWrite.All, and Sites.ReadWrite.All. Add also "Delegated permission" for include offline_access, openid.

IMPORTANT : Grant admin consent so the application can use these permissions.

PART 2 : Set Odoo System Parameters

You need your tenant_url, you can find it in your Azure portal, open Home > Dashboard. Look at the URL, it's usually ends with onmicrosoft.com.

In Odoo, open Settings > Technical > System Parameters.

Required parameters:

  • microsoft_account.auth_endpoint : This is the Microsoft OAuth2 authorization URL. It usually has the form: https://login.microsoftonline.com/{tenant_url}/oauth2/v2.0/authorize
  • microsoft_account.token_endpoint : This is the token endpoint URL, usually: https://login.microsoftonline.com/{tenant_url}/oauth2/v2.0/token
  • microsoft_drive_client_id : The Client ID of the Azure application.
  • microsoft_drive_client_secret : The Client Secret value generated in Azure.

Optional parameter :

  • microsoft_drive_client_scope : Defines the permissions requested by Odoo. If not defined, Odoo uses the default scopes: offline_access, openid, Files.ReadWrite.All, Sites.ReadWrite.All.

PART 3 : Test the Configuration

Step 1 – In Odoo, go to your odoo profile and select "Account Security",then click on the “grey cloud icon".

Step 2 – You will be redirected to the Microsoft login page. Sign in and accept the requested permissions. You will then be redirected back to Odoo.

Step 3 – After authorization, Odoo should display a "blue cloud icon". The connection is now established.

On the user preference page, the user can link their Microsoft Drive account to Odoo by cliking on the Drive button. This will redirect the user to the Microsoft authentication page, where they can log in and grant permission to Odoo to access their Drive account. Once the user has granted permission, they will be redirected back to Odoo, where their Drive account will be linked.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.