Skip to Content
Menu
This question has been flagged
6322 Views

Hey,

I've been trying to update custom fields via XMLRPC but couldn't get it working so far.
Is there anything I need to add to XMLRPC-module or so to get those also to be accessible???

Any help appreciated!

EDIT:

public function Erp_product_update($pro_array, $userId, $client ) {

$msg2 = new xmlrpcmsg('execute');

$msg2->addParam(new xmlrpcval(Mage::getStoreConfig('magerpsync/magerpsync/dbname'), "string"));

$msg2->addParam(new xmlrpcval($userId, "int"));

$msg2->addParam(new xmlrpcval(Mage::getStoreConfig('magerpsync/magerpsync/pwd'), "string"));

$msg2->addParam(new xmlrpcval("magento.product", "string"));

$msg2->addParam(new xmlrpcval("create_product", "string"));

$msg2->addParam(new xmlrpcval($pro_array, "struct"));

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

}



$pro_array = array(

'name'=>new xmlrpcval($name, "string"),

'description'=>new xmlrpcval($desc, "string"),

'description_sale'=>new xmlrpcval($srt_desc, "string"),

'list_price'=>new xmlrpcval($onepro->getPrice(), "string"),

'standard_price'=>new xmlrpcval($product->getCost(), "string"),

'taxes_id'=>$tax1,

'supplier_taxes_id'=>$tax2,

'type'=>new xmlrpcval($type, "string"),

'categ_ids'=>new xmlrpcval($erp_categ_ids, "array"),

'default_code'=>new xmlrpcval($sku, "string"),

'weight_net'=>new xmlrpcval($onepro->getWeight(), "double"),

'product_id'=>new xmlrpcval($pro_id, "int"),

'method'=>new xmlrpcval('write', "string")

);

$this->Erp_product_update($pro_array, $userId, $client);


this works...

but when I add a field like this which before has the right string in the variable:


'x_manufacturer'=>new xmlrpcval($manufacturer, "string"),


then it's not working for this field in Odoo...

Avatar
Discard

XMLRPC doesn't care if a field is custom or not, the call works the exact same way. What does your XMLRPC request look like? It's much more likely that the XMLRPC call isn't accurate.

Author

Well... that would be very weird, because all the other fields in the array are transmitted fine... this would be the array: $pro_array = array( 'name'=>new xmlrpcval($name, "string"), 'description'=>new xmlrpcval($desc, "string"), 'description_sale'=>new xmlrpcval($srt_desc, "string"), 'list_price'=>new xmlrpcval($product->getPrice(), "string"), 'type'=>new xmlrpcval($type, "string"), 'categ_ids'=>new xmlrpcval($erp_categ_ids, "array"), 'default_code'=>new xmlrpcval($sku, "string"), 'weight_net'=>new xmlrpcval($product->getWeight(), "double"), 'mage_id'=>new xmlrpcval($product->getId(), "int"), 'method'=>new xmlrpcval('create', "string") 'x_manufacturer'=>new xmlrpcval($product->getAttributeText('manufacturer'), "string"), ); $this->Erp_product_update($pro_array, $userId, $client); and public function Erp_product_update($pro_array, $userId, $client ) { $msg2 = new xmlrpcmsg('execute'); $msg2->addParam(new xmlrpcval(Mage::getStoreConfig('magerpsync/magerpsync/dbname'), "string")); $msg2->addParam(new xmlrpcval($userId, "int")); $msg2->addParam(new xmlrpcval(Mage::getStoreConfig('magerpsync/magerpsync/pwd'), "string")); $msg2->addParam(new xmlrpcval("magento.product", "string")); $msg2->addParam(new xmlrpcval("create_product", "string")); $msg2->addParam(new xmlrpcval($pro_array, "struct")); $resp = $client->send($msg2); maybe it has something to do with decoding the XML Data within the xmlrpc library??? How can I check what's Odoo getting at XMLRPC interface?

Related Posts Replies Views Activity
3
Jul 25
2629
1
Oct 24
1887
1
Apr 24
1965
0
Sep 23
1554
1
Jun 23
2033