Odoo Help


Why am I getting a "list indices must be integers, not str" error while creating an order line via the XML-RPC?

on 3/23/14, 2:13 PM 1,860 views

I'm trying to create an order via XML-RPC using the OpenERP Online. All the referenced objects (products, customers and an empty order) are created fine. I get an error "list indices must be integers, not str" while creating the order line. Here are the (pretty-printed) request and response:


<?xml version="1.0" encoding="UTF-8"?>
<methodCall xmlns:ex="....">
        <member><name>name</name><value>Order line name</value></member>


<?xml version="1.0"?>
            <string>list indices must be integers, not str</string>
Traceback (most recent call last):  
File "/home/odoo/src/server/saas-3/openerp/service/wsgi_server.py", line 75, in xmlrpc_return    result = openerp.netsvc.dispatch_rpc(service, method, params)  
File "/home/odoo/src/server/saas-3/openerp/netsvc.py", line 240, in dispatch_rpc    result = dispatch(method, params)  
File "/home/odoo/src/server/saas-3/openerp/service/model.py", line 37, in dispatch    res = fn(db, uid, *params)  
File "/home/odoo/src/server/saas-3/openerp/service/model.py", line 113, in wrapper    return f(dbname, *args, **kwargs)  
File "/home/odoo/src/server/saas-3/openerp/service/model.py", line 181, in execute    res = execute_cr(cr, uid, obj, method, *args, **kw)  
File "/home/odoo/src/addons/saas-3/audittrail/audittrail.py", line 526, in execute_cr    return fct_src(cr, uid, model, method, *args, **kw)  
File "/home/odoo/src/server/saas-3/openerp/service/model.py", line 159, in execute_cr    return getattr(object, method)(cr, uid, *args, **kw)  
File "/home/odoo/src/addons/saas-3/sale/sale.py", line 844, in create    defaults = self.product_id_change(cr, uid, [], order['pricelist_id'][0], values['product_id'],TypeError: list indices must be integers, not str

What is the cause of this problem?

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 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

1 follower(s)


Asked: 3/23/14, 2:13 PM
Seen: 1860 times
Last updated: 3/16/15, 8:10 AM