Odoo Help

Welcome!

This community 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.

0

Script Import Error odoo v9

By
Coralie Cardon
on 2/15/16, 4:00 AM 476 views

Hello, 

Itry to Import with a script my partner, 

I have a traceback but i don't know why ! 

It's for Odoo V9 

This is my traceback : 


Traceback (most recent call last):

File "societe.py", line 206, in <module>

comp=sock.execute(dbname, uid,pwd, 'res.partner','create', data)

File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__

return self.__send(self.__name, args)

File "/usr/lib/python2.7/xmlrpclib.py", line 1591, in __request

verbose=self.__verbose

File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request

return self.single_request(host, handler, request_body, verbose)

File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request

return self.parse_response(response)

File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response

return u.close()

File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close

raise Fault(**self._stack[0])

xmlrpclib.Fault


my code : 

username = "admin"

pwd = "admin"

dbname = "data"

comp = 0

sock_common = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/common")

uid = sock_common.login(dbname, username, pwd)

print "uid>>>>>>>>>>",uid

sock = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/object")

reader = csv.reader(open('partner.csv','rb'),delimiter=';')

print "readderr",reader

x = 1

.......

the end :

comp=sock.execute(dbname, uid,pwd, 'res.partner','create', data)

Thanks for your help ! 

can you try with sock.execute_kw method... and xmlrpc/2/xxx insteand of xmlrpc/xxx ? If it doesn't work, can you upload your simplified script and a simplified csv.

Jérémy Kersten (jke)
on 2/15/16, 4:09 AM

What is this method ? Can you show me plz ? Thanks

BHC SPRL, Coralie Cardon
on 2/15/16, 4:18 AM

Just replace your execute by execute_kw keeping same args! And Just replace thé rpc version in server proxy.

Jérémy Kersten (jke)
on 2/15/16, 12:31 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/15/16, 4:00 AM
Seen: 476 times
Last updated: 2/15/16, 4:04 AM