Odoo Help


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


how to make a field that I can save a image?

on 8/22/16, 9:13 AM 175 views

how to make a field that I can save a image?

I have try it like this:

def _get_image(self, cr, uid, ids, name, args, context=None):

result = dict.fromkeys(ids, False)

for obj in self.browse(cr, uid, ids, context=context):

result[obj.id] = tools.image_get_resized_images(obj.image)

return result

def _set_image(self, cr, uid, id, name, value, args, context=None):

return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)

'image': fields.binary("Image",

help="This field holds the image used as image for our customers, limited to 1024x1024px."),

but this is not working. any help? thank you

I also want to know how to save a figure and even more when we plot a figure by matplotlib.pyplot, whether this figure can be saved in "fields.Binary()"?

on 8/22/16, 10:02 PM

What version are you using?

Giezel Esteves
on 8/22/16, 10:44 PM
On 8/24/16, 2:23 AM

I found a way on odoo 8. 

It's very simple.

You only need to define a binary field and there you can save your image.

Your Answer

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

About This Community

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

Question tools

1 follower(s)


Asked: 8/22/16, 9:13 AM
Seen: 175 times
Last updated: 8/24/16, 2:24 AM