Yes, my approach gets the image and stores it in a binary field in the "database".
By using osv_memory it is a temporary "table" not saved to the underlaying postgres, but held in memory.
This temporary table is then read by a normal view <field> to view the image.
Something alone these (untested) lines:
Code:
class my_image(osv.osv_memory):
_name = "my.image"
_rec_name = "image"
def _get_image(self, cr, uid, ids, field_name, arg, context):
ret = {}
picture_res = urllib2.urlopen('http://www.google.com/images/logos/ps_logo2.png')
picture = picture_res.read()
for id in ids:
ret [id] = picture
return ret
_columns = {
"image": fields.function(_get_image, string="Image", type="binary", method=True),
}