OpenERP currently stores images such as human resources Avatar pictures are stored in a binary way in the database, to modify the database only the storage path can be used in this way
Image Adorner:
Image adorner contains 3 picture display
Image big picture
Pictures in Image_medium
Image_small Small picture
We see in the OpenERP source code there is a two method _get_image, _set_image, here we need to rewrite the two methods
def_get_image (Self, CR, UID, IDS, name, args, context=None)://other omitted Fr=file (' Apath ','RB') //At this point the file is in a folder on the hard disk, Apath is the file path Result[obj.id]=tools.image_get_resized_images (Base64.b64encode (Fr.read ()))//Be sure if Base64 data fr.close ()returnresultdef_set_image (Self, CR, UID, ID, name, value, args, context=None):#eg file path is named Apath//file write to hard disk Apath path omitted, write yourselfreturnSelf.write (cr,uid,[id],{'ImagePath': Apath},context=context)
OpenERP Picture Path processing