Odoo Help

shashank verma
On 11/11/14, 7:16 AM

Hello Roma,

Efficient way is to run python script by  using csv library. https://docs.python.org/2/library/csv.html

Lets take simple example as a reference.

NOTE: Lets assume your binary format image data stored on 3rd column in csv file

import csv

username = ''
password = ''
database = ''
sock_comm = xmlrpclib.ServerProxy('http:yourdomain/xmlrpc/common')

uid = sock_comm.login(database,username,password)

sock = xmlrpclib.ServerProxy('http:yourdomain/xmlrpc/object')

with open('my_file.csv', 'rb') as csvfile:
    spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
    for row in spamreader:
         ids = sock.execute(database,uid, password,'product.product', 'search', [('default_code','=',files_name)])
        for i in ids:

            sock.execute(database,uid, password,'product.product', 'write',i,{'image_medium':row[2]})



@shashank, thanks for your answer. I'm interested in doing a similar thing although i'd like to specify a URL, or local path instead of the binary format in CSV. I would be interested to hear any suggestions or advice you have.

Luke Branch
on 11/12/14, 1:05 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 11/10/14, 1:55 AM
Seen: 1123 times
Last updated: 10/29/15, 5:43 AM