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 List Countries - Can't do parentesis

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

Hi,

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

The call that openerp uses to list is:

object.execute('robo_config',1,'*','res.country','name_search',(),{
                                                                '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.

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

0 follower(s)

Stats

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