Odoo Help

0

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

By
cd
on 8/30/13, 6:24 PM 1,148 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--
17320
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

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. 

I am a skilled Communicator and I only take the serious things seriously!

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

Register

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)

Stats

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