Hi, I spend more than three hours trying to understand how to create an order using Odoo 11 and Python with no luck.
The smallest example I came to is this:
uid = common.authenticate(db, username, password, {})
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
order = models.execute_kw(db, uid, password, 'sale.order', 'create', {
'name': 'new sale order',
})
But I get:
File "./conexion.py", line 29, in <module>
'name': 'new sale order',
File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 2: ''>
What's wrong with my code?.
XML-RPC: http://learnopenerp.blogspot.com/2019/10/connecting-to-odoo-using-xml-rpc.html