[Openerp-community] Image store problem in Odoo

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Openerp-community] Image store problem in Odoo

Falinwa Hans
Hi Guys,

I find that the image in Odoo is stored in database.
Did we can change the configuration so it can stored in the file system?
I can't find the tutorial anywhere. So I think we cannot.

What I know is we can change the configuration when we want to store the attachment, but its different case in image.

I think its an important feature for Odoo, importantly Odoo will have an e-commerce and website builder feature which we will have a lot of image in Odoo.

I find that its very important and there's a problem when the image is stored in database :
1. Odoo not convert the size/resolution of the image. (We must warned the end user to only just upload a small size of file, which usually user always make a mistake)
2. Its very hard to make an importation on image
3. The database will be very big because of image, and it will be hard to make a dump file(backup and restore) in web interface.
(which end user always use this feature to make a test database which image is not important in here)

If we can change the configuration so we can store it in file system and save the database only the name of file. We will have advantage:
1. It will be  easier to make an importation of image.
2. We will not care about file size anymore because it save on file system.
3. The database size will reduce greatly.

Before I have a problem in attachment, when my database size raise to 2 GB which impossible to make a dump(backup and restore) in web interface. After I change the configuration the database size reduce greatly to only 30 MB.
So I think this problem will occur again if we begin to upload the image in Odoo.

Is there any solution for this?

Thank You.
Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Yannick Buron-2
+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :

> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Openerp-community] Image store problem in Odoo

Falinwa Hans

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Franck Bret
there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Openerp-community] Image store problem in Odoo

Falinwa Hans

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

sebastien beau
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>

> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

digitalsatori
In reply to this post by Falinwa Hans
Hi Hans,

Glad to have been of help and thanks for your appreciation of our other works.


Best regards,
Tony Gu --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213  Skype: digitalsatori
http://www.openerp.cn
OpenERP Consultans China Linkedin Group
OpenERP Official Partner in China

On 06/11/2014 06:45 PM, Falinwa Hans wrote:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Yannick Buron-2
In reply to this post by sebastien beau
Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Aristóbulo Meneses
Yannick,

if you are using a folder to store images you can overwrite product's img method and return the correct path to the image. 

then at your template call <img src="{{ img(product.id, field="something" }} /> also you will need to add this method to values dict in main.py controller.

Hope it helps,

Aristobulo




2014-06-11 10:43 GMT-04:30 Yannick Buron <[hidden email]>:
Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--
La experiencia es la más dura maestra;
primero pone la prueba, luego dá la explicación...
-------------------------------------------------------------------------

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Aristóbulo Meneses
Sorry Hans not Yannick,

if you are using a folder to store images you can overwrite product's img method and return the correct path to the image. 

then at your template call <img src="{{ img(product.id, field="something" }} /> also you will need to add this method to values dict in main.py controller.

Hope it helps,

Aristobulo


--
La experiencia es la más dura maestra;
primero pone la prueba, luego dá la explicación...
-------------------------------------------------------------------------

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Stephen Mack
In reply to this post by Falinwa Hans
According to Fabien's opendays talk, images can be stored on the file system since version 6.1 and in version 8.0, this will be the default behavior.


--Stephen

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Openerp-community] Image store problem in Odoo

Falinwa Hans

Hi Stephen,

 

Nice to know that Odoo has worked it on V8.

Thanks for the information.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Stephen Mack [via OpenERP Community] [mailto:[hidden email]]
Sent: Thursday, June 12, 2014 1:33 AM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

According to Fabien's opendays talk, images can be stored on the file system since version 6.1 and in version 8.0, this will be the default behavior.

 

 

--Stephen


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645770.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community, click here.
NAML

Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

sebastien beau
In reply to this post by Yannick Buron-2
Hi,
@Yannick
I didn't try it on 8 version, and as the API have changed I have to adapt it in order to implement it in the same way.
I talked to Raphael Collet about the storage of images, he like my idea.
I will try to take a look on it for 8 version during the weekend and I will propose a MP to new version with the 8 API style before the end of the month.

@Mariano Ruiz
hum interesting comment
What do you think by replacing it by 
ImageField(..... resize_base_on="my_original_image", height=64, width=64)

and if the field resize_base_on is here than I have the same behaviours as my previous class ImageResizeField, do you like it? (note : fields height and width will be required if resize_base_on is fill)

Also I am thinking about an other change, what to you think about introducing an OpenERP/Odoo object "storing.configuration" and a field "storing_configuration_id" on the model "ir.model.fields". The idea will to use a default storing configuration for every field (on file sytem for exemple) but after we will be able to customise on every field from the backend where where you want to store each binary/image fields (database, S3, ftp, SFTP, Filestore....)
Do you like the idea? (not so hard to implement)

Thanks  for your feedback


2014-06-11 17:13 GMT+02:00 Yannick Buron <[hidden email]>:
Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Parthiv Patel
+1 for store configuration idea, has a possibility of extending it via CDN in future for e-commerce.


On Thu, Jun 12, 2014 at 11:02 AM, Sebastien Beau <[hidden email]> wrote:
Hi,
@Yannick
I didn't try it on 8 version, and as the API have changed I have to adapt it in order to implement it in the same way.
I talked to Raphael Collet about the storage of images, he like my idea.
I will try to take a look on it for 8 version during the weekend and I will propose a MP to new version with the 8 API style before the end of the month.

@Mariano Ruiz
hum interesting comment
What do you think by replacing it by 
ImageField(..... resize_base_on="my_original_image", height=64, width=64)

and if the field resize_base_on is here than I have the same behaviours as my previous class ImageResizeField, do you like it? (note : fields height and width will be required if resize_base_on is fill)

Also I am thinking about an other change, what to you think about introducing an OpenERP/Odoo object "storing.configuration" and a field "storing_configuration_id" on the model "ir.model.fields". The idea will to use a default storing configuration for every field (on file sytem for exemple) but after we will be able to customise on every field from the backend where where you want to store each binary/image fields (database, S3, ftp, SFTP, Filestore....)
Do you like the idea? (not so hard to implement)

Thanks  for your feedback


2014-06-11 17:13 GMT+02:00 Yannick Buron <[hidden email]>:

Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--
Thanks & Regards,
Parthiv Patel

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

sebastien beau
In reply to this post by Falinwa Hans
Just a quick note, what Fabien mean is that attachment can be store on DB or file. But binary field, image field is always store in database. So we need to improve it ;)


2014-06-12 3:58 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Stephen,

 

Nice to know that Odoo has worked it on V8.

Thanks for the information.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Stephen Mack [via OpenERP Community] [mailto:[hidden email]]
Sent: Thursday, June 12, 2014 1:33 AM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

According to Fabien's opendays talk, images can be stored on the file system since version 6.1 and in version 8.0, this will be the default behavior.

 

 

--Stephen


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645770.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community, click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Raphael Valyi
Hello,

an other precision,
the system designed by Sebastien is not trying to re-invent the wheel, instead, on the surface API, it is largely inspired from Dragonfly http://markevans.github.io/dragonfly
which is the standard in many many Ruby web application to deal with binary assets.
I suggest we stick close to the this proven design.

We decided that design after I adapted Ooor and Aktooor to support Dragonfly, so assets can by dealt the same way in OpenERP.

Regards.

-- 
Raphaël Valyi
Founder and consultant
+55 21 3942-2434



On Thu, Jun 12, 2014 at 3:04 AM, Sebastien Beau <[hidden email]> wrote:
Just a quick note, what Fabien mean is that attachment can be store on DB or file. But binary field, image field is always store in database. So we need to improve it ;)


2014-06-12 3:58 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Stephen,

 

Nice to know that Odoo has worked it on V8.

Thanks for the information.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Stephen Mack [via OpenERP Community] [mailto:[hidden email]]
Sent: Thursday, June 12, 2014 1:33 AM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

According to Fabien's opendays talk, images can be stored on the file system since version 6.1 and in version 8.0, this will be the default behavior.

 

 

--Stephen


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645770.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community, click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Yannick Buron-2
In reply to this post by sebastien beau
Ok Sebastien, thank you for you hard work.

+1 for the storing.configuration, as said by Parthiv it would be great for managing CDN in the future.

Le 12/06/2014 07:32, Sebastien Beau a écrit :
Hi,
@Yannick
I didn't try it on 8 version, and as the API have changed I have to adapt it in order to implement it in the same way.
I talked to Raphael Collet about the storage of images, he like my idea.
I will try to take a look on it for 8 version during the weekend and I will propose a MP to new version with the 8 API style before the end of the month.

@Mariano Ruiz
hum interesting comment
What do you think by replacing it by 
ImageField(..... resize_base_on="my_original_image", height=64, width=64)

and if the field resize_base_on is here than I have the same behaviours as my previous class ImageResizeField, do you like it? (note : fields height and width will be required if resize_base_on is fill)

Also I am thinking about an other change, what to you think about introducing an OpenERP/Odoo object "storing.configuration" and a field "storing_configuration_id" on the model "ir.model.fields". The idea will to use a default storing configuration for every field (on file sytem for exemple) but after we will be able to customise on every field from the backend where where you want to store each binary/image fields (database, S3, ftp, SFTP, Filestore....)
Do you like the idea? (not so hard to implement)

Thanks  for your feedback


2014-06-11 17:13 GMT+02:00 Yannick Buron <[hidden email]>:
Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

sebastien beau
Hi I finish the implementation of storage.configuration

You can test and review the code here (yes on github!!!!)


It's should support 8 version too but I didn't test it (if someone can)

Thanks for your feedback


2014-06-12 9:44 GMT+02:00 Yannick Buron <[hidden email]>:
Ok Sebastien, thank you for you hard work.

+1 for the storing.configuration, as said by Parthiv it would be great for managing CDN in the future.

Le 12/06/2014 07:32, Sebastien Beau a écrit :
Hi,
@Yannick
I didn't try it on 8 version, and as the API have changed I have to adapt it in order to implement it in the same way.
I talked to Raphael Collet about the storage of images, he like my idea.
I will try to take a look on it for 8 version during the weekend and I will propose a MP to new version with the 8 API style before the end of the month.

@Mariano Ruiz
hum interesting comment
What do you think by replacing it by 
ImageField(..... resize_base_on="my_original_image", height=64, width=64)

and if the field resize_base_on is here than I have the same behaviours as my previous class ImageResizeField, do you like it? (note : fields height and width will be required if resize_base_on is fill)

Also I am thinking about an other change, what to you think about introducing an OpenERP/Odoo object "storing.configuration" and a field "storing_configuration_id" on the model "ir.model.fields". The idea will to use a default storing configuration for every field (on file sytem for exemple) but after we will be able to customise on every field from the backend where where you want to store each binary/image fields (database, S3, ftp, SFTP, Filestore....)
Do you like the idea? (not so hard to implement)

Thanks  for your feedback


2014-06-11 17:13 GMT+02:00 Yannick Buron <[hidden email]>:
Thank you Sebastien, I think this is what we are all looking for.

I am currently testing it for the marketplace module. I have the following error :

Traceback (most recent call last):
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 470, in dispatch
    result = self._call_function(**self.params)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 652, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp/oct-dev/server/openerp/http.py", line 337, in response_wrap
    response = f(*args, **kw)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1046, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/openerp/oct-dev/web/addons/web/controllers/main.py", line 1038, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/openerp/oct-dev/addons/mail/mail_thread.py", line 419, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/openerp/oct-dev/server/openerp/osv/orm.py", line 3946, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/opt/openerp/oct-dev/server/openerp/osv/fields.py", line 1287, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 156, in _fnct_write
    obj, cr, uid, ids, field_name, value, args, context=context)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 128, in _fnct_write
    res = storage.add(value)
  File "/opt/openerp/oct-dev/server-env-tools/binary_field/fields.py", line 61, in add
    _file_write(self.cr, self.uid, self.location, value)
TypeError: _file_write() takes exactly 4 arguments (5 given)


I checked the server/openerp/base/ir/ir_attachment.py line 129, it seems that the function changed :
   def _file_write(self, cr, uid, value):

In general, all 'location' seems to have disappeared, in -file_read, _file_delete and _full_path.

I am using the latest trunk file. I guess the module may correctly work on V7.

Available this evening if you need.
Yannick.



Le 11/06/2014 15:43, Sebastien Beau a écrit :
Hi all, 

I worked on this during the last month and I need your feedback https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

The aim of my first module is to implement new kind of fields

BinaryField
ImageField
ImageResizeField


All of this fields will be store on the file system by default and not in the
database. If you want to store it on an other support (database, S3, ftp, SFTP...)
Then you should create your own 'storage class' and use your custom 'storage 
class' instead

The default Storage class will store the field on the file system and build 
the path like that
 
 BASE_LOCATION/DB_NAME/MODEL-FIELD/XXX/YYYYY

with

- BASE_LOCATION: the base location configured in ir.config_parameter
- DB_NAME:  your database name
- MODEL-FIELD: the concatenation of the name of the model with the name of the
field, for example 'product_product-image'
- XXX: the first 3 letter of the file name build with their sha1 hash
- YYYYYY: file name build with their sha1 hash

Here is an example of field declaration

    'binary_test': fields.BinaryField('Test Binary'),
    'image_test': fields.ImageField('Test Image'),
    'image_test_resize': fields.ImageResizeField(
        related_field='image_test',
        string='Test Image small',
        height=64,
        width=64,
        ),



If you want to see to a real implementation take a look here :


You can also try this module to understand better the way it work. (Note resize field will be recomputed automatically as this field depend of refernce field)

As you can see I have a custom path based on the model-field. I need this because I want to serve some image directly from nginx without using OpenERP/Odoo. If I use the same path for all of the binary/image then I will be not able to choose what I want to share with nginx.


Hope this can help you.


2014-06-11 12:45 GMT+02:00 Falinwa Hans <[hidden email]>:

Hi Tony,

 

Wow, I look on the code, and its very beautiful.

Thanks for the solution, I think it will solved the problem for now.

Very appreciated it.

I remember that you developed oe_cn_fonts module too.

It’s a great work.

 

Hi Franck Bret,

 

Thanks for the information, its nice to see that we have the same problem in this topic.

 

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

On 06/11/2014 06:28 PM, Tony Gu wrote:

 

Hi Hans,

You may be interested to have a look at our module here: https://github.com/shine-it/product_image_filestore
The image on product can be save as an attachment of the product and display correctly on the product form. If you have product image stored in database already, this module will also extract the binary and store it back to file store.

Have fun!

 

 

From: Franck Bret [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 6:31 PM


To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

there is a community call for discussion around this here, hope it helps

https://twitter.com/Seb_Beau/status/474847322887974912

https://code.launchpad.net/~akretion-team/server-env-tools/server-env-tools

Interesting read and module too here :

https://bitbucket.org/anybox/advanced_attachment
http://docs.anybox.fr/advanced_attachment/current/

Le 11/06/2014 11:48, Falinwa Hans a écrit :

Hi Yannick,

 

Thx for your response.

I see the code, and it’s a nice idea. I will keep it on myself.

 

It will be nicer if the improvement is made from Odoo framework itself.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Yannick Buron-2 [via OpenERP Community] [mailto:[hidden email]]
Sent: Wednesday, June 11, 2014 5:06 PM
To: Falinwa Hans
Subject: Re: [Openerp-community] Image store problem in Odoo

 

+1 I have the same problem with the marketplace module in
communityTools. We need to have pictures displayed on the announcements,
and I really don't want to store them in database.

I worked on the problem three month ago, and at this time the problem
was : There was no way to store the content of binary fields on the
ir.attachments, and thus store the content in filesystem.
When you set the ir_location key in system configuration, ir.attachments
are correctly stored in filesystem, the problem is really the fact that
there is no link between binary fields and ir.attachments.

I tried to make a workaround in my module, please see
http://bazaar.launchpad.net/~yannick-buron/openerp-communitytools/trunk/view/head:/marketplace/marketplace.py 
starting line 173. It almost work, the content is stored in filesystem,
but unfortunately then it's not displayed back correctly on the form in
the picture widget. I only spent some hours on this problem, so maybe
there is little to correct to make it works.

This was an issue three month ago, with the ecommerce module I really
hope that Odoo SA worked on this because having such limitations on
binary fields is really a pain. Does someone have some news regarding
this matter?

Yannick.


Le 11/06/2014 10:49, Falinwa Hans a écrit :


> Hi Guys,
>
> I find that the image in Odoo is stored in database.
> Did we can change the configuration so it can stored in the file system?
> I can't find the tutorial anywhere. So I think we cannot.
>
> What I know is we can change the configuration when we want to store the
> attachment, but its different case in image.
>
> I think its an important feature for Odoo, importantly Odoo will have an
> e-commerce and website builder feature which we will have a lot of image in
> Odoo.
>
> I find that its very important and there's a problem when the image is
> stored in database :
> 1. Odoo not convert the size/resolution of the image. (We must warned the
> end user to only just upload a small size of file, which usually user always
> make a mistake)
> 2. Its very hard to make an importation on image
> 3. The database will be very big because of image, and it will be hard to
> make a dump file(backup and restore) in web interface.
> (which end user always use this feature to make a test database which image
> is not important in here)
>
> If we can change the configuration so we can store it in file system and
> save the database only the name of file. We will have advantage:
> 1. It will be  easier to make an importation of image.
> 2. We will not care about file size anymore because it save on file system.
> 3. The database size will reduce greatly.
>
> Before I have a problem in attachment, when my database size raise to 2 GB
> which impossible to make a dump(backup and restore) in web interface. After
> I change the configuration the database size reduce greatly to only 30 MB.
> So I think this problem will occur again if we begin to upload the image in
> Odoo.
>
> Is there any solution for this?
>
> Thank You.
>
>
>
>
> -----
> Hans Yonathan
> OpenERP Support
> FALINWA Limited
> Expert in Finance & Business Intelligence
> OpenERP Silver Partner
> Website: www.falinwa.com
>
> --
> View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755.html
> Sent from the OpenERP Community mailing list archive at Nabble.com.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645757.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website:
www.falinwa.com

 


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
-- 
Franck Bret
============
Consultant fonctionel OpenErp
------------
[hidden email]
Gsm. 0603906598


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


If you reply to this email, your message will be added to the discussion below:

http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4645760.html

To start a new topic under OpenERP Community, email [hidden email]
To unsubscribe from OpenERP Community,
click here.
NAML

Hans Yonathan
OpenERP Support
FALINWA Limited
Expert in Finance & Business Intelligence
OpenERP Silver Partner
Website: www.falinwa.com


View this message in context: RE: [Openerp-community] Image store problem in Odoo
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

Falinwa Hans
Hi Sebastien,

I tried to use your module, for image field is working fine.
For BinaryField, we can upload, and it can save to our filestore, the problem is when we want to download the file, we cannot open the file anymore.
can you take a look?
I tried your example module, and the behaviour is the same.
Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Openerp-community] Image store problem in Odoo

sebastien beau
Hi, thanks for telling me this issue.
I plan to work again on this topic really soon (I will try to do it before end of october). Indeed after some discution with Odoo Team, we want to include my work directly in the core for the 9 version (yes !).
I will refactor this module as I want to have for 7 and 8 (in a commnunity module) the same datamodel as the version 9, so migration will be really easy.

Thanks for your feedback

2014-10-15 18:40 GMT+02:00 Falinwa Hans <[hidden email]>:
Hi Sebastien,

I tried to use your module, for image field is working fine.
For BinaryField, we can upload, and it can save to our filestore, the
problem is when we want to download the file, we cannot open the file
anymore.
can you take a look?
I tried your example module, and the behaviour is the same.



-----
Hans Yonathan
Odoo Support
FALINWA Limited
Expert in Finance & Business Intelligence
Odoo Silver Partner
Website: www.falinwa.com

--
View this message in context: http://openerp-community.2306076.n4.nabble.com/Openerp-community-Image-store-problem-in-Odoo-tp4645755p4646719.html
Sent from the OpenERP Community mailing list archive at Nabble.com.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
12
Loading...