Odoo Help


XMLRPC List Countries - Can't do parentesis

Vitor Robosavvy
on 12/12/13, 11:32 AM 1,502 views


I'm using the phpxmlrpc and i'm trying to get the country list from openerp.

The call that openerp uses to list is:

                                                                'args': [['id', 'not in', []]],
                                                                'context': {'lang': 'en_GB', 'tz': 'Europe/Lisbon', 'uid': 1},
                                                                'limit': 8,
                                                                'name': 'P',
                                                                'operator': 'ilike'

And what i could do for now is:

object.execute('robo_config',1,'*','res.country','name_search',[],{'name': 'a', 'operator': 'ilike'})

With this php code

$msg = new xmlrpcmsg('execute');
    $msg->addParam(new xmlrpcval($this->database, "string"));  //* database name */
    $msg->addParam(new xmlrpcval($this->uid, "int")); /* useid */
    $msg->addParam(new xmlrpcval($this->passwrod, "string"));/** password */
    $msg->addParam(new xmlrpcval($model_name, "string"));/** model name where operation will held * */
    $msg->addParam(new xmlrpcval($searh_name, "string"));/** method which u like to execute */

    $search_keys = array();
    foreach( $keys as $k )
        $key = array(new xmlrpcval(array(new xmlrpcval($k[0] , "string"),
              new xmlrpcval($k[1],"string"),
              new xmlrpcval($k[2],"string")),"array"),

        $search_keys[] = new xmlrpcval($key,"array");

    $msg->addParam(new xmlrpcval($search_keys,"array"));

    $msg->addParam(new xmlrpcval($args,"struct"));

The thing is how can i do the '()' ( after 'name_search' ) that are on the openerp call? I tried array and struct and it doesn't work.


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

0 follower(s)


Asked: 12/12/13, 11:32 AM
Seen: 1502 times
Last updated: 3/16/15, 8:10 AM