Google Drive Attachments
Google Drive as a cloud storage provider for Odoo's own migration: large chatter attachments move from the filestore into a Drive folder
Request a live demo · Odoo.sh or On-Premise only, not Odoo Online (SaaS).
27
automated tests, none failing
0
Google tokens handed to a browser
1
Drive folder holds every moved file
7 days
minimum age before Odoo moves a file
10
sample files moved to Drive in the screenshots
0
files made public or shared by link
Google Drive Attachments is for the Odoo administrator whose company already lives in Google Workspace and whose filestore keeps growing. Odoo 19 ships cloud storage for Google Cloud Storage and for Azure Blob, free, in Community. It does not ship Google Drive. This app adds Drive as one more provider in that same list, so the settings page, the migration job and the progress bar you already have start filling a Drive folder.
Connect one Google account, name a folder, choose which models to migrate in Odoo's own settings, and the large attachments leave the filestore on the schedule Odoo already runs. Opening one afterwards works as before: the file is fetched from Drive by your server, so Odoo's access rights still decide who may read it.
The screenshots on this page are Odoo's own screens, taken in a fresh Odoo 19 database seeded with made-up data: a fictitious industrial supplier, four opportunities and twelve attachments. Google's consent screen and Drive's own web pages are not shown. To take the pictures, a small stand-in server answered the module's Drive calls, so every figure beside a picture is read off Odoo, not off a Google account.
How it works
Why Google Drive, and what this app adds
Large attachments pile up in the chatter: signed contracts, site surveys, drawings, photo sets. Each one sits in the Odoo filestore on your server's disk, is copied into every backup, and has to be carried along on every migration. Moving them out is the goal, and Odoo 19 already contains the machinery for it.
Cloud Storage and Cloud Storage Migration let an administrator pick a provider, pick models, and let a scheduled job move the matching attachments. The providers Odoo ships are Google Cloud Storage and Azure Blob. Google Cloud Storage is a developer product: a bucket, a service account key, a billing project. For a company that already pays for Google Workspace, the thing people can actually open is a Drive folder.
The rest of this page walks through the five things you will do or see: connect the account, migrate, open files, trust the credentials handling, and recover from errors. Then the honest limits.
1 Connect one Google account, once
Use it when you set this up, once per database.Writes when saved
Cloud services want credentials, and credentials are where integrations go wrong: a token that works until tomorrow, a redirect that breaks another feature, a secret anyone can read in the settings.
A Google Drive block inside Odoo's Cloud Storage settings with three fields and one link: Google OAuth Client ID , Google OAuth Client Secret (shown masked, readable only by Settings administrators) and Drive Folder ID , then Connect Google Account . Once an account is connected the link reads Reconnect Google Account . The Cloud Storage Provider field above it gains one choice, Google Drive .
Settings, Cloud Storage block, before connecting: the Google Drive block with Client ID, Secret, Folder ID and the Connect link.
The provider list, opened. Google Drive sits next to the providers Odoo ships (here Azure were installed too).
After Google sends you back: a plain page that says what happened and links to Settings.
Maya, the administrator of the sample company, enters a Client ID, a Secret and the ID of a folder called Odoo Attachments, saves, and presses Connect. Google returns her to the module's own page, which reads Google Drive connected. Back in Settings the link now says Reconnect Google Account . She picks Google Drive as the provider and saves; Odoo asks Drive whether the folder exists, is a folder, and may take new files, and accepts it.
Had the folder ID been wrong, the save would have stopped with Could not use that Google Drive folder and the reason Google gave (see section 5).
a connected account and a verified folder. The refresh token is kept in Odoo; nothing about it is shown on screen.
Only a Settings administrator can finish the connection. Anyone else who opens the return address is sent back to Settings, and a response that does not match the administrator's own session is rejected with a message.



2 Move attachments with Odoo's own migration
Use it when the filestore is too big and you want the large chatter files in Drive.Moves files when run
Moving thousands of files by hand, or by script, means deciding what is safe to move, in what order, and how to see progress. Odoo already answers all of that; it only lacked a Drive destination.
Once a provider is chosen, Odoo's Cloud Storage Migration block appears: a Cron Job link, Parameters , a progress bar, an Attachments Report showing size and count per model, and two model pickers. Message Attachments moves only files attached to messages; All Attachments moves every attachment of the models you pick. The Minimum File Size field sets the threshold; Odoo's default is 20 MB, and the sample database uses 0.10 MB so that small test files qualify.
Before the run: progress at 0 %, and Contact and Lead picked under All Attachments.
After the run: the bar at 100 %. Ten files had moved.
The sample database holds twelve attachments on four opportunities, with Contact and Lead picked under All Attachments. The job moved ten. One file, a commissioning checklist, was two days old; Odoo leaves anything younger than seven days alone in case business code is still reading it. One file, a 680-byte contact card, was under the 0.10 MB minimum.
In Drive, each moved file is named by Odoo's own blob name, the attachment number, a unique code and the file name, for example 24/ad9c78e7-.../Master-Services-Agreement-Northfield.pdf , and sits directly in the folder you named.
the large, older attachments of the models you chose now live in your Drive folder, and the two that did not qualify stayed where they were.
Run Manually on the migration job only schedules the run. This app never uploads from your browser (section 4), so it hands the run to the cron worker and tells you so; the upload itself happens there. Nothing is skipped, no empty file is created in Drive and the progress marker does not move until files are actually moved.


3 Open, preview and download as before
Use it when someone clicks a migrated attachment and expects it to open.Reads from Drive
A storage move is only worth it if nobody notices afterwards. The attachment has to open from the chatter, show its thumbnail and download with the right name, and only for people who were allowed to see it before.
Nothing different. A migrated attachment appears in the chatter like any other, with its thumbnail if it is an image. Under Settings > Technical > Attachments the record now reads Type: Cloud Storage and its Url is a Drive address.
The chatter of the Packaging line refit opportunity: the image thumbnail and the PDF card, both served from Drive.
Attachments grouped by Type: the Cloud Storage group holds the ten moved files.
One migrated attachment: Type is Cloud Storage and the Url is its Drive address.
Requesting the 2.4 MB Master-Services-Agreement-Northfield.pdf from the sample opportunity returned status 200, content type application/pdf and 2,400,002 bytes, identical to the bytes Drive held (compared by hash). No redirect to Google was involved: Odoo fetched the file with its own token and passed it on. The 1.8 MB Line-Layout image loaded the same way, which is why its thumbnail shows in the chatter.
Because the file passes through Odoo, a user who could not open that opportunity before cannot open the attachment now either.
the same file, the same name and the same access rules, now stored in Drive.
Downloads use your server's bandwidth and memory. Odoo reads the whole file from Drive before sending it on, with a 30 second read timeout, so very large files put real load on the server. Files migrated by earlier versions of this app still show a size of 0.



4 Your Google credentials stay on the server
Use it when you care who can see the connection to your Drive.Changes nothing
Odoo's cloud storage can let the browser upload a large file straight to the provider, because a bucket can issue a link that allows one upload and nothing else. Google Drive has no equivalent: every Drive call needs the account's bearer token, and Odoo's uploader copies the headers it is given into the browser's request. Used as is, that would put your Drive token in the browser of everyone who attaches a file.
Nothing, by design. While Google Drive is the provider this app switches the browser upload path off. A new large attachment is created in Odoo as usual, and the migration job moves it later, from the server.
With Drive selected, the session information Odoo sends to every browser contained no cloud storage keys, in a live check on both versions; Odoo's web client therefore never starts a browser upload. An automated test asserts the same, and asserts that switching the provider back to another one restores those keys.
The connection itself is guarded too. The Client Secret field is readable by Settings administrators only, the return address checks a code tied to the administrator's session and database, and the app asks Google only for access to files it created.
the token is used by the server alone, and an attempt to hand it to a browser is refused.
A Google consent screen left in Testing mode makes Google expire refresh tokens after seven days. When that happens every Drive call fails with an instruction to reconnect, rather than retrying in silence.
5 Clear errors, and a guarded way out
Use it when something is misconfigured, revoked, or you want to change provider.Stops before harm
Storage integrations fail quietly: an unreachable cloud returns an empty file, a revoked grant retries forever, a changed provider leaves files nobody can reach. Each of those is a worse day than a plain error message.
Messages that say what to do. A folder Drive rejects is refused when you save. A revoked or expired connection says to reconnect. Changing the provider while any file still lives in Drive is refused.
Switching provider while Drive still holds files is refused.
A revoked or expired grant says to reconnect, in plain words.
A folder Drive cannot use is refused at save, with the reason Drive gave.
After the migration, Maya tries to switch the provider to Azure and presses Save. Odoo refuses: some attachments still live in Google Drive. Later the Google grant is revoked and she saves a changed folder ID: the dialog says the connection was revoked or expired and where to reconnect. A third time she types a folder ID that does not exist, and Drive's 404 is shown to her as the reason.
The routine that brings a file back out of Drive is part of the app and is tested: it returns the same bytes and switches off Odoo's image downsizing for that write, so a screenshot is not quietly shrunk on the way home. Odoo itself calls it when a report needs a remote file. What does not exist is a button that runs it for every file.
a failed connection stops loudly with the next step, instead of shipping empty documents or stranding files.
The first message above says Odoo cannot move files back, and that is accurate: Odoo ships no screen for it and this app adds none. If you may want to leave Drive later, ask us first. A revoked grant is noticed when the current access token runs out, up to about an hour later, because each Odoo process keeps its token until then. Until it does, calls still work.



Who is it for?
Good fit. A company on Google Workspace with an Odoo.sh or On-Premise database whose chatter files (contracts, surveys, drawings, photo sets) are growing, and an administrator who wants them in a folder the business can open, using the migration job Odoo already runs.
Also a fit. A partner who wants to offer Drive-backed storage to a client without building a connector.
Not a fit. Anyone who needs invoices, vendor bills, payments, employee files, expense receipts or applicant CVs moved (Odoo's own rules keep those local), anyone who needs two-way sync with files already in Drive, and anyone on Odoo Online, where third-party apps cannot be installed.
Honest limits: what this app does not do
We would rather you read these here than discover them in production.
Questions buyers ask
Can the browser upload straight to Drive?
No. Drive offers no one-shot upload links, so the app switches that path off and the migration job uploads from the server.
Are my files public in Drive?
No. The app never shares a file. Opening an attachment streams it through Odoo, so Odoo's access rights decide who can read it.
Will it move my invoices?
No. Odoo itself excludes the models whose code reads the file bytes, and in Community that includes invoices, payments, employee files, expenses, leaves and applicants.
Can it adopt files already in my Drive?
No. It only sees files it created, because it asks for the drive.file scope.
What happens if I rename a file in Drive?
Odoo is not told, and nothing syncs back. Leave moved files where Odoo put them.
What happens if I delete an attachment in Odoo?
The Odoo record goes and the app deletes its file from the Drive folder. If Drive cannot be reached at that moment the record is still deleted and the file stays in the folder; a warning is written to the server log.
How do I start the migration?
Press Run Manually on the migration job, or set its Next Execution Date to now. Either way the cron worker does the upload; Run Manually only schedules it and says so.
Can I move everything back out of Drive?
Not with a button. Switching provider is refused while any file lives in Drive, so decide before you migrate. Ask us first if you may want to leave Drive.
Is the other Odoo version included?
No. The store sells each Odoo version of an app as a separate product.
Requirements
- Odoo 19.0 or 20.0. The App Store sells each version separately, so buy the one that matches your database.
- Odoo.sh or On-Premise only. Third-party apps cannot be installed on Odoo Online (SaaS) databases. Check your hosting before buying.
- Module
mh_drive_attachments, version 19.0.1.0.14, licensed OPL-1.