Odoo Help


JSONRPC : search_read with partner_id.country_id=76 but can not display partner_id.country_id

on 3/2/15, 5:05 AM 1,349 views

I use a simple JSONRPC query, to search_read all sale orders created with partners with country = 76 (France)



It's working fine.

My question is : if it's possible to search on a joined field (partner_id.country_id in this case), why it seems impossible to display the content of this joined field, in the query result ?




Gives only the "name" of sale orders. Syntax problem ? Or real technical impossibility ? And if so, what would be the reason ?

On 3/2/15, 11:57 AM

I looked at the server with the SQL debug mode... and it's not really pretty.

I thought that the ORM was capable of doing JOIN queries...

With my example, actually, the system performs first a SELECT on res.partner to retrieve the IDs of all the partners who have country = 76... In my case : a few thousands of IDs... !

And then, another SELECT... on sale.order to find SO with... partner_id among the previous list of IDs.

No JOIN queries, brutal force instead. And therefore, no way to display columns from res.partners with a simple search_read query on sale.order.

If I understand the ORM's logic, I would need to inherit the model sale.order, add a few columns (partner.id.country, or phone, or whatever else) linked to the res.partner model, I would need to work on "on change" stuff, and fix some list views.

Lot of work, isn't it?

Or do I miss something obvious ?

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/2/15, 5:05 AM
Seen: 1349 times
Last updated: 3/16/15, 8:10 AM