Cloud Storage Sync Base: attachments sync with folder rules, queue and migration
by Aerya IT Solutions https://aerya.net$ 97.52
Odoo 17, 18, 19 and 20, Community and Enterprise · Developed in the European Union by Aerya IT Solutions
Your Odoo attachments, mirrored to the cloud folder you choose
Folder rules decide where each record's files go, for example Customers/Acme/2026/Quotation. A queue sends them in the background, retries what fails, cuts big files in resumable chunks and never overwrites a change made in the cloud without telling you. Odoo keeps its own copy, so nothing is lost if you uninstall.
Existing files migrated with a dry run and a progress bar
Conflict, deletion and retry policies you set per account
Credentials visible to Cloud Storage managers only
Runs on Odoo.sh and on-premise, not on Odoo Online (SaaS), where Odoo does not allow modules with Python code. Please buy the version that matches your database.
Screenshots of Odoo 17 Enterprise with the data of a fictitious company.
path templates, queue, retries, chunks and resume, conflicts, deletions, migration, rights, multi-company and the forms in the browser
no warnings, on the four versions
Community and Enterprise
Folder rules per model
A rule picks a model, a record filter and a folder template: Customers/{name}, Sales/{partner_id.name}/{date_order:%Y}/{name}. The first matching rule of an account decides the folder; names are made safe for every provider and a name already taken in the folder gets the attachment number, never overwriting a file that is not yours.

One account per company, one place for the rules
The account holds the location, the root folder, the chunk size, the number of attempts and the policies. Test Connection checks the credentials; the status, the waiting files and the problems show on the form. Several accounts can mirror the same files.

A queue that survives bad days
New and changed attachments are queued; a scheduled action sends them every 5 minutes within a time budget, so no long cron timeout is needed. A failed file retries after 1, 2, 4 minutes up to 6 hours (the server's Retry-After is honoured); a server that is down or refuses the password stops the run without using up attempts and notifies the followers of the account.

Failures you can read
Every file shows its state, attempts, next try and the server's answer. A name the cloud rejects fails that file only; Retry sends it again after you fixed the cause.

Conflicts do not lose data
Before overwriting, the stored ETag is compared with the server's. Keep both sends Odoo's version as name (conflict date).ext; Odoo wins overwrites; Cloud wins parks the file as Conflict with two buttons to resolve it. Deleted attachments go to a trash folder, are deleted or are kept, as you choose.

Migrate what you already have
A dry run counts the files and the megabytes your rules cover, then one click queues them. The progress bar follows the sending, failures are counted, and a second migration finds nothing left.

More screenshots

Folder rules

The sync log
The problem: files in Odoo that the rest of the company works with elsewhere
Quotations, invoices, contracts and scans pile up as attachments in Odoo, while the company keeps its documents on a Nextcloud, an ownCloud, a WebDAV server or a network share. Someone copies files across by hand, the folder structure differs from one person to the next, and a customer folder on the share never matches the customer in Odoo. Moving the files by script is brittle: a big file times out, a server that is down loses the run, and two copies of a file overwrite each other.
What the module does
Cloud Storage Sync mirrors the attachments of Odoo records to a cloud folder tree that you describe with folder rules. A queue sends the files in the background, retries what fails and keeps a log. Odoo keeps its own copy of every file, so the cloud holds a copy and nothing is lost if you disconnect it.
How it works, step by step
- Install the module and a provider. The base comes with the provider Server folder (a mounted NAS share or disk of the Odoo server). A separate provider module adds the cloud itself, for example aerya_cloud_webdav for Nextcloud, ownCloud and WebDAV.
- Create an account in Cloud Storage > Accounts: one location per company, with the root folder, the chunk size, the number of attempts, the conflict policy and the deletion policy. Press Test Connection.
- Add folder rules in Cloud Storage > Folder Rules: a model, a record filter and a folder template such as Customers/{partner_id.name}/{date_order:%Y-%m}. The first rule of an account that matches the record decides the folder.
- Let the queue work. A new or changed attachment is queued, and the scheduled action Cloud Storage: process the sync queue sends it every 5 minutes. Send Now on the account runs the queue at once.
- Follow the files. Cloud Storage > Files shows the state of each file, with Retry, Retry Failed, Open in Cloud and Open Record. Cloud Storage > Sync Log lists every send, move, conflict, deletion and error.
- Move what you already have. In Cloud Storage > Migrations, Dry Run counts the files and megabytes the rules cover, then Send Existing Files queues them and a progress bar follows.
Details that matter
- Safe folder names. Names are made valid for every provider: no backslash, colon, asterisk, question mark, quote, angle bracket or pipe, no .., and at most 100 characters per segment.
- Retries. A failure is retried after 1, 2 and 4 minutes, up to 6 hours (a server Retry-After is honoured). After the attempts of the account, the file is marked Failed until a manager retries it. A server that is down or refuses the password stops the run without using up attempts and notifies the followers of the account.
- Large files. Files above the chunk size go in chunks when the provider can. Each chunk is committed, so a crash or timeout resumes at the first chunk not accepted, and a changed file restarts. A run stops at its time budget of 240 seconds, so no long cron timeout is needed.
- Conflicts. Before overwriting, the module compares the ETag with the one stored at the last sync. Keep both saves Odoo's version as name (conflict date).ext. Odoo wins overwrites. Cloud wins leaves the file as Conflict until a manager chooses Use Odoo Version or Keep Cloud Version.
- Deletions. When an attachment is deleted in Odoo, the cloud copy is moved to .odoo-trash/date, deleted or kept, as the account says.
- The log is cleaned after 90 days.
Settings and access
Accounts, folder rules, migrations and the policies are in the Cloud Storage menu, for the Manager group of the module. Credentials are fields of the provider module and are visible to managers only. Accounts, rules, files, migrations and logs are separated by company. The module adds no package to install on the server.
What it does not do
- It does not pull files from the cloud into Odoo, replace the Odoo file by a link, give a file manager view or share files publicly.
- Binary fields, URL attachments and attachments without a record are not sent.
- It refuses an invalid root folder (an absolute server folder is needed for Server folder, not the root of the disk, and not a folder Odoo uses itself), a chunk size outside 1 to 512 MB, fewer than one attempt, and a record filter or folder template that names a field the model does not have.
- A migration that already started cannot be started twice.
Requirements
Odoo 17, 18, 19 and 20, Community and Enterprise. It needs the Odoo Discuss app (mail) and a provider module for your cloud. It has Python code, so it runs on Odoo.sh and on-premise, not on Odoo Online. Languages: English, Spanish and Romanian.
Questions
Can I lose files if the connection breaks?
No. Odoo keeps its own copy of every file and the queue retries until the account's attempts are used.
Which clouds work?
The Server folder provider is included, and the WebDAV provider module covers Nextcloud, ownCloud and WebDAV. Other providers are separate modules.
What if the file changed on both sides?
The conflict policy of the account decides: keep both, Odoo wins, or cloud wins with a manager's choice.
Can I send the files I already have?
Yes. A migration counts them in a dry run, then queues them.
Does it work with several companies?
Yes. Each company has its own account, rules and log.
What happens if I uninstall it?
Nothing is lost. The files stay in Odoo and the copies stay in the cloud.
Explore our other apps
More modules by Aerya IT Solutions for Odoo 19, built to work together.
Questions or a custom quote?
Write to info@aerya.ro for questions about the module, its installation or custom development.
Developed in the European Union by Aerya IT Solutions, Odoo implementation and development. aerya.net
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 2137 |
| Technical Name |
aerya_cloud_base |
| License | OPL-1 |
| Website | https://aerya.net |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module