Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
6404 Lượt xem

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...

Ảnh đại diện
Huỷ bỏ

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.

Tác giả

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?

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
2823
1
thg 10 24
2054
1
thg 4 24
2081
0
thg 9 23
1644
1
thg 6 23
2131