Odoo Help

Welcome!

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.

2

How to store product images in the filesystem in odoo[v8]

By
af
on 1/22/15, 6:47 AM 3,798 views

How can I store the product images in the filesystem instead of in the DB?

I tried adding product_image.location with value file:///filestore to my system parameters but that didn't work. Also ir_attachment.location file:///filestore has no effect.

@ Stephen. I cannot comment on your answer. I followed your link but nothing is working. moreover there are so many solutions I don't know which is the latest working. As far as I understood it schuld be Key : ir_attachment.location Value: file When I do that there is a file created in my filestore folder. /opt/odoo/odoo-server/filestore/filestore/dbname/41/41e8284229e6b03a10a150dfbd1388564236c284 Content is: PNG Image: ‘41e8284229e6b03a10a150dfbd1388564236c284’ pixelWidth: 68 pixelHeight: 68 Thats an attachement I added to a product as a internal note Apart from the fact that it doesn't store anything useful, the question for me is how to store product images on the filesystem. I tried importing them but I just have to much pictures. The csv file with the base64 encoded pictures is 1GB. When I create a new product with the above settings activated nothing happens. Picture is a blob in the product.template table

af
on 1/22/15, 11:01 AM
1

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 1/22/15, 7:59 AM

Thanks to tsabi https://github.com/odoo/odoo/issues/2633 

In Odoo 8 ir_attachment image store in filesystem system parameters has been changed.
Odoo using the menu Parameters --> System Parameters
Create new record with the details Key:  file and Value: file:///filestore
and in the openerp-server.conf File set the data_dir path
Example,
   data_dir = D:\filestore

 

Odoo product image store in file system the below link may be useful:-
http://www.maxmakedesign.co.uk/development/2014/odoo-binary-field/

In order to have more flexible file serving functionality within Odoo,
you can swap out binary fields for a functional field that returns
the contents of your file.

 

 

0

Stephen Mack

--Stephen Mack--
5023
| 8 8 9
Santiago, Chile
--Stephen Mack--

Some people call me a karma whore, I only ask for 10 points if you like my answer and 15 if I happen to get it correct.

Stephen Mack
On 1/22/15, 9:50 AM

Hi Af,

Odoo can be configured to store the attachments in the Database or on the filesystem.  You can read this classic forum post on how to change from one to the other.  There is also a user developed script to help move the attachments one time.

0
af
On 1/22/15, 9:21 AM

Thank you for your answer but unfortunately I cannot get it to work

My /etc/odoo-server.conf has this entry data_dir = /opt/odoo/odoo-server/files. I set permissions to 755

Odoo created 3 folders inside. sessions, addons, filestore

After restarting the whole server, odoo still saves product pictures and attachements as binary in the DB

@ Stephen. I cannot comment on your answer. I followed your link but nothing is working. moreover there are so many solutions I don't know which is the latest working. As far as I understood it schuld be Key : ir_attachment.location Value: file When I do that there is a file created in my filestore folder.

/opt/odoo/odoo-server/filestore/filestore/dbname/41/41e8284229e6b03a10a150dfbd1388564236c284

Content is:

PNG Image: ‘41e8284229e6b03a10a150dfbd1388564236c284’

pixelWidth: 68

pixelHeight: 68

Thats an attachement I added to a product as a internal note Apart from the fact that it doesn't store anything useful, the question for me is how to store product images on the filesystem. I tried importing them but I just have to much pictures. The csv file with the base64 encoded pictures is 1GB. When I create a new product with the above settings activated nothing happens. Picture is a blob in the product.template table

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

2 follower(s)

Stats

Asked: 1/22/15, 6:47 AM
Seen: 3798 times
Last updated: 1/6/16, 1:57 AM