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

Why search not working fine with filter qty_available. e.g. "qty_available = 4" ?

By
pacific112j
on 3/19/14, 8:41 AM 3,206 views

I'm using php and xmlrpc. When I use qty_available, no matter what type of filter using, respond is always all ids.

       $args_search=array(
         new xmlrpcval(array(
                 new xmlrpcval("qty_available","string"), 
                 new xmlrpcval("=","string"),
                 new xmlrpcval("4","string")
          ),
         "array")
       );    
       $sock=new xmlrpc_client($url_obj);
       $msg=new xmlrpcmsg('execute');
       $msg->addParam(new xmlrpcval($db, "string"));
       $msg->addParam(new xmlrpcval($uid, "int"));
       $msg->addParam(new xmlrpcval($pwd, "string"));
       $msg->addParam(new xmlrpcval("product.product", "string"));
       $msg->addParam(new xmlrpcval("search", "string"));
       $msg->addParam(new xmlrpcval($args_search, "array"));
       $resp = $sock->send($msg);
       $val=$resp->value();
       $ids=$val->scalarval();
       $num = count($ids);
         for ($i=0; $i<$num; $i++)
         {
            $id=$ids[$i]->scalarval();
            echo "--> id: ".$id;
         }

I's working fine when use e.g. "price_extra=150" . Do I have to pass some other attribute like location?

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: 3/19/14, 8:41 AM
Seen: 3206 times
Last updated: 3/16/15, 8:10 AM