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

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

By
cd
on 8/30/13, 6:24 PM 946 views

The Question has been closed

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

0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

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

Yes.

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 !

Thanks.

cd
on 8/31/13, 4:08 AM

About This Community

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

Question tools

1 follower(s)

Stats

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