Search code examples
odooxml-rpcodoo-8

Get full objects of one2many records instead of just IDs via XMLRPC in Odoo


When doing a "read" or "search_read" method call on a model using XMLRPC in Odoo, by default only list of ids of one2many records is returned. Is there a way to get whole objects of relational model class instead of just ids?

Of-course I can get records of related table in a separate XMLRPC call and then match the ids to get full objects. But I was just curious that is there anyway to do it in a single XMLRPC call???


Solution

  • Not that I am aware of in the read/search_read methods. The alternative would be to do a custom coarse-grained method that assembles the results you want and hands it back. Same thing with many2many fields AFAIK.