Odoo Help


XMLRPC read partner : why columns are not in the order asked ? [Closed]

on 8/30/13, 6:24 PM 1,212 views

The Question has been closed

Ray Carnes
on 08/31/2013 13:48:48

I send a XMLRPC query to read an ID on res.partner, on a freshly installed database with sample data.

The arguments passed are :

['phone', 'country_id', 'name']

Those arguments can be seen (identical) in the debug rpc logs.

Problem 1 : the results of the query do not follow the order (country + name + phone instead of phone + country + name).

openerp.netsvc.rpc.response: object.execute time:0.028s mem: 189004k -> 189004k (diff: 0k)
{'country_id': (13, u'Austria'),
'id': 23,
'name': u'PARTENAIRE1',
'phone': u'phone'}

Problem 2 : then, when I receive the XML file,the columns are in another order (a third one) ! Not the one asked, not the one printed in the logs...

I'm lost.

I've tried to add other columns to the query... The order of results seen on the log is always the same... however it changes each time on the XML file (without any logical pattern).

What's going on ? To set the list of columns for the read is not to set the order those columns will be printed ?

Is that normal behavior ?

Ray Carnes
On 8/31/13, 2:07 AM


The returned structure is the same as a Python dictionary.

It is best to think of a dictionary as an unordered set of key: value pairs, where the keys are unique (within one dictionary). The actual order of key: value is not something you can change and is not something you should rely on - you should parse the data in the dictionary based on the key.

OK I got it. I was focused on OpenERP and forgot about Python !


on 8/31/13, 4:08 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

1 follower(s)


Asked: 8/30/13, 6:24 PM
Seen: 1212 times
Last updated: 3/16/15, 8:10 AM