Skip to Content
Menu
This question has been flagged

Sometimes we need to download one or several of the files that Odoo has generated (invoices, XMLs, contracts, images, etc.). Here’s a practical way to do it.


Tools Needed:

  • Access to your Odoo database (with developer permissions), here’s how you can do it. 
  • A spreadsheet tool (e.g., Excel or Google Sheets)
  • A mass download manager (e.g., JDownloader)


Work Flow:

Step-by-Step Guide:

Enable Developer Mode in Odoo

Go to settings and select “Activate the developer mode”


Create a Server Action to Make Attachments Public

In the main menu type: Server Actions, select the first option.

In the server actions view create a new one and name it “Publish attachments”. The configuration has to be this:


Then just click on “Create Contextual Action”


Access the Attachment List

In your main menu, type attachments and select “Settings / Technical / Database Structure / Attachments”


Select the Documents You Want to Download

You can use filters by model, name, date, type of file, etc.

Run the Server Action to Make the Files Public

Select the filtered records and execute your public access action.

Disclaimer: When we run the Server Action we are going to make public all of the attachments, which means anyone with the link can access them, so at the end we are going to run the server action again to make them private again.


Export the Selected Attachments

Use the "Export" option and make sure to include the local_url field from the ir.attachment model.

In the exported file, add a Column with Your Database Domain, name it Database URL

Example: https://edu-victorcorp.odoo.com (repeat this for all rows).

Create a New Column to Concatenate the Domain + local_url

Excel formula: =L3&K3

Where L3 is the domain and K3 is the file path.

Copy all of the “Real URL” and paste them into Your Download Manager

In JDownloader, Select add URL → paste all the URLs → choose the destination folder → start the download.

1


2


3

4


*IMPORTANT: Make the Attachments Private Again.

  1. Go to back to the server action that you created and update the action details and set the “to” field to “No (False)”
  2. Go back to the attachments, select the published attachments, and run the server action again to set the files private.

Avatar
Zrušiť

Alternatively, you can sync the required attachment to a cloud client (e.g., Google Drive or OneDrive) using the tool https://apps.odoo.com/apps/modules/18.0/cloud_base. Then, you can comfortably navigate through the folders and download any attachment combinations

Related Posts Replies Zobrazenia Aktivita
4
apr 25
12975
1
apr 25
358
0
jan 25
814
1
jan 25
1162
1
nov 24
970