Odoo Help


how do i call onchange on many2many that will return domain to another many2many field using xmlrpc in php

chirag jogi
on 3/22/16, 6:01 AM 1,879 views

I'hv define onchange in odoo 9 on many2many field how do i call in xmlrpc in php

My onchange function in odoo-9 which returns domain to another many2many field



def onchange_get_comp_component(self):




if cpu_rec_lines:

for record in cpu_rec_lines:


if record.socket_type:


return {'domain':domain}

when I am trying to call onchange in following code

calling function

public function button_click($model, $method, $record_ids){

$client = new xmlrpc_client($this->server."object");


$client->return_type = 'phpvals';

// ['execute','userid','password','module.name',{values....}]

$nval = array();

$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->password, "string"));/** password */

$msg->addParam(new xmlrpcval($model, "string"));/** model name where operation will held * */

$msg->addParam(new xmlrpcval($method, "string"));/** method which u like to execute */

$msg->addParam(new xmlrpcval($record_id, "int"));/** parameters of the methods with values.... */

$resp = $client->send($msg);

if ($resp->faultCode())

return -1; /* if the record is not created */


return $resp->value(); /* return new generated id of record */



how do I call onchange on many2many fields(cpu_lines) that will return domain to another many2many field(motherboard_lines) in xmlrpc php

Thanks in advance

On 3/22/16, 10:18 AM

You should add 'cpu_lines'  to the method args in your call. Try to replace 

  $msg->addParam(new xmlrpcval($record_id, "int"));/** parameters of the methods with values.... */

with  :

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

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/22/16, 6:01 AM
Seen: 1879 times
Last updated: 3/22/16, 10:18 AM