OdooWiki OCA HUB

Attachment Synchronize

attachment_synchronize folder_open OCA/server-tools open_in_new
Generic Modules License: AGPL-3

This module allows to import/export files from/to backend servers.

A backend server is defined by the basic fs_storage OCA module, while it can be configured (amazon S3, sftp,...) with additional modules fs python libraries

The imported files (and the files to be exported) are stored in Odoo as attachment.queue objects, defined by the attachment_queue module while the importation itself (resp. exportation) is realized by "Attachments Import Tasks" (resp. "Attachments Export Tasks") defined by this current module.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Create scheduled tasks that automatically import files from an external storage backend into Odoo attachments, or export Odoo attachments back to that backend, with options to rename, move, delete or skip duplicates.

This module adds a new screen called 'Attachment synchronize task' where you define a job that either imports files from an external storage backend or exports Odoo attachments to it. Each task is linked to a storage backend and a file path, and you choose whether it is an Import Task or an Export Task.

For import tasks you can: - Select files using a pattern (for example *.txt) or take everything in the folder. - Avoid importing files that already exist as attachments. - After import, automatically rename, move, move and rename, or delete the source file. Renaming can use a template based on the original file name. - Assign a file type to the created attachments and set failure notification emails.

For export tasks, pending attachments linked to the task are sent to the backend, and the folder is created if needed. If the transfer times out, it is retried later.

Tasks can be run manually with a Run button, or automatically by a scheduled job (disabled by default, runs every 30 minutes when enabled). The task form shows counters for failed, pending and done attachments, and the storage backend form shows how many import and export tasks use it. Menus appear under the storage menu as 'Attachments Import Tasks' and 'Attachments Export Tasks'.

Menus it adds

menu_attachment_import_taskmenu_attachment_export_task
Models and fields (3)
  • fs.storage · extends an existing modelexport_task_count (Export Tasks), import_task_count (Import Tasks), synchronize_task_ids (Tasks)
  • attachment.queue · extends an existing modeltask_id (Task), file_type, method_type, fs_storage_id (Filestore Storage)
  • attachment.synchronize.task · new modelname, active (Enabled), pattern (Selection Pattern), filepath (File Path), new_name, file_type, move_path, backend_id (Backend), method_type, after_import, attachment_ids (Attachment), failure_emails, count_attachment_done, avoid_duplicated_files (Avoid importing duplicated files), count_attachment_failed, count_attachment_pending

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: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/server-tools.

terminal Installation and usage

OCA documentation · Odoo 18.0

As importation and exportation are different processes, they are triggered in different ways :

To import files, you need to create an "Attachment Import Task" (menu Settings \> Technical \> Attachments Import Tasks) which defines :

  • where to find the files to import from the backend server (path to the files, selection pattern)
  • what to do with the source files in the backend server (avoid duplicates, delete/rename after import...)
  • how the files will be processed once imported (through the File Type field).

> 🔎 The File Type options are defined by other modules built to > process the Attachments Queues with the same "File Type".

To export files, you need first to register them as "Attachments Queues" objects linked to an "Attachment Export Task" (which set automatically their File Type to "Export File (External Location)").

Then, you can export one file at a time from the Attachment Queue's form view, or export all the Attachments Queues in a pending state related to the same Export Task from the given Export Task form view (menu Settings \> Technical \> Attachments Export Tasks) :

No verified information in OCA: Installation, Configuration.

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.