python - Odoo8. Upload product image programmaticaly -


i image url , try upload odoo (product.template, image column). tried many methods none of them helped me. give me right way upload image of product odoo without using csv import. thank you.

this worked me :

import urllib2 import base64  image = urllib2.urlopen('http://ddd.com/somepics.jpg').read()  image_base64 = base64.encodestring(image)  product.image_medium = image_base64    //(new api v9)  #in old api maybe   #prod_obj.write(prod_id, {'image_medium': image_base64}) 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -