Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
6394 Visualizzazioni

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
Abbandona

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.

Autore

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?

Post correlati Risposte Visualizzazioni Attività
3
lug 25
2805
1
ott 24
2046
1
apr 24
2070
0
set 23
1637
1
giu 23
2124