Ir al contenido
Menú
Se marcó esta pregunta
6296 Vistas

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
Descartar

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.

Autor

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?

Publicaciones relacionadas Respuestas Vistas Actividad
1
oct 24
1831
1
abr 24
1896
2
mar 24
2483
0
sept 23
1504
1
jun 23
1977