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
Post a Comment