Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How I can save attachments to file system? [Closed]

on 4/9/13, 5:12 AM 5,883 views

The Question has been closed

Ray Carnes
on 04/11/2013 14:50:20

In OpenERP 7, install module document. Now files can attach with records, but it saves in database. How I can change to save in file system?

In OpenERP 6, this can configure at Knowledge / Document Management / Storage Media. This is not found in OpenERP 7...?

Ivica Dimitrijev
On 4/9/13, 5:19 AM

This question has been answered several times. Search for: Where are document Attachments stored?

I'm quoting the answer:

In OpenERP v7, by default, attachments are stored in the database. You may choose to store them on the filesystem by setting an ir.config.parameter (Settings->Technical->Parameters-System parameters) named ir_attachment.location

Example if you set ir_attachment.location to file:///filestore

They will be stored in the filesystem at openerp root_path/filestore, the new system uses sha1 to generate the filename so that duplicate files don't take more space.

Only the file:/// scheme is implemented, modules can implement additional scheme like amazons3:///

In database mode the data is stored in ir_attachment.db_datas. Filestore mode file name is stored in ir_attachment.db_datas_fname.

Those names suck but we kept them for backwards compatibility.

No automatic conversion mechanism exists.

If you set this parameter existing attachments remain stored in the database, only NEW ones will be stored in the filesystem. But the system will try both location so it's not a problem (db_datas is checked first then db_datas_fname).

If you remove this parameter you should manually store back the files in the database because the system will only look in the database.

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 4/9/13, 5:12 AM
Seen: 5883 times
Last updated: 3/16/15, 8:10 AM