Skip to Content
Menu
This question has been flagged

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 ! 

Avatar
Discard

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.

Author

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

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

Related Posts Replies Views Activity
1
Feb 16
3939
0
Mar 15
2503
0
Mar 15
2532
1
Aug 22
1511
1
Jul 18
2875