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

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -