вчера я работал над созданием xmlrpc для своего программного обеспечения для электронной коммерции для odoo. Следуйте odoo общей ошибке, я переустанавливаю odoo.
Я ничего не трогаю и у меня сейчас эта ошибка и я в Администраторе.
Может быть, я что-то забыл или в коде odoo произошли небольшие изменения ????
Поблагодарить
Неустранимая ошибка: вызов функции-члена scalarval () для необъекта в /home/www/clicshopping_test_ui/boutique/ClicCpanel/ext/odoo_xmlrpc/xml_rpc_admin_customers.php в строке 173
print_r($response) do that :
object(xmlrpcresp)[36]
public 'val' => int 0
public 'valtyp' => null
public 'errno' => int -1
public 'errstr' => string '' (length=0)
public 'payload' => null
public 'hdrs' =>
array (size=4)
'content-type' => string 'text/xml' (length=8)
'content-length' => string '446' (length=3)
'server' => string 'Werkzeug/0.9.6 Python/2.7.8' (length=27)
'date' => string 'Sat, 25 Oct 2014 14:45:31 GMT' (length=29)
public '_cookies' =>
array (size=0)
empty
public 'content_type' => string 'text/xml' (length=8)
public 'raw_data' => string 'HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 446
Server: Werkzeug/0.9.6 Python/2.7.8
Date: Sat, 25 Oct 2014 14:45:31 GMT
<?xml version='1.0'?>
faultCode
предупреждение — AccessError
Запрошенная операция не может быть завершена из-за ограничений безопасности. Пожалуйста, обратитесь к системному администратору.
(Тип документа: res.partner, Операция: чтение)
faultString
мой xml-rpc
// **********************************
// search iso code ClicShopping
// **********************************
$QcountryIdCustomer = $OSCOM_PDO->prepare("select entry_country_id
from :table_address_book
where customers_id = :customers_id
");
$QcountryIdCustomer->bindInt(':customers_id', (int)$customers_id );
$QcountryIdCustomer->execute();
$country_id_customer = $QcountryIdCustomer->fetch();
$country_id_customer = $country_id_customer['entry_country_id'];$QcountryCode = $OSCOM_PDO->prepare("select countries_iso_code_2
from :table_countries
where countries_id = :countries_id
");
$QcountryCode->bindInt(':countries_id',(int)$entry_country_id);
$QcountryCode->execute();
$country_code = $QcountryCode->fetch();
$country_code = $country_code['countries_iso_code_2'];
// **********************************
// search id country odoo
// **********************************
$domain_filter = array (
new xmlrpcval(
array(
new xmlrpcval('code' , "string"),
new xmlrpcval('=',"string"),
new xmlrpcval($country_code,"string"),
),"array"),
);
$client = new xmlrpc_client($server_url . "/xmlrpc/object");
$client->setSSLVerifyPeer(0);
$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval($dbname, "string"));
$msg->addParam(new xmlrpcval($uid, "int"));
$msg->addParam(new xmlrpcval($password, "string"));
$msg->addParam(new xmlrpcval("res.country", "string"));
$msg->addParam(new xmlrpcval("search", "string"));
$msg->addParam(new xmlrpcval($domain_filter, "array"));
$response = $client->send($msg);
if ($response->faultCode()){
echo $response->faultString();
}
$result = $response->value();
$ids = $result->scalarval();
$id_list = array();
/*
for($i = 0; $i < count($ids); $i++){
$id_list[]= new xmlrpcval($ids[$i]->me['int'], 'int');
}
*/
$id_list[]= new xmlrpcval($ids[0]->me['int'], 'int');
$field_list = array(new xmlrpcval("country_id", "int"),
new xmlrpcval("name", "string"),
);
$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval($dbname, "string"));
$msg->addParam(new xmlrpcval($uid, "int"));
$msg->addParam(new xmlrpcval($password, "string"));
$msg->addParam(new xmlrpcval("res.country", "string"));
$msg->addParam(new xmlrpcval("read", "string"));
$msg->addParam(new xmlrpcval($id_list, "array"));
$msg->addParam(new xmlrpcval($field_list, "array"));
$resp = $client->send($msg);
$result = $resp->value()->scalarval();
/*
for($i = 0; $i < count($result); $i++){
$country_id_odoo = ($result[$i]->me['struct']['id']->me['int']);
}
*/
$country_id_odoo = $result[0]->me['struct']['id']->me['int'];
// **********************************
// Search odoo customer id
// **********************************
$domain_filter = array (
new xmlrpcval(
array(
new xmlrpcval('ref' , "string"),
new xmlrpcval('=',"string"),
new xmlrpcval('WebStore - ' . $customers_id,"string"),
),"array"),
);
$client = new xmlrpc_client($server_url . "/xmlrpc/object");
$client->setSSLVerifyPeer(0);
$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval($dbname, "string"));
$msg->addParam(new xmlrpcval($uid, "int"));
$msg->addParam(new xmlrpcval($password, "string"));
$msg->addParam(new xmlrpcval("res.partner", "string"));
$msg->addParam(new xmlrpcval("search", "string"));
$msg->addParam(new xmlrpcval($domain_filter, "array"));
$response = $client->send($msg);
$result = $response->value();
$ids = $result->scalarval();
$id_list = array();
/*
for($i = 0; $i < count($ids); $i++){
$id_list[]= new xmlrpcval($ids[$i]->me['int'], 'int');
}
*/
$id_list[]= new xmlrpcval($ids[0]->me['int'], 'int');
$field_list = array(new xmlrpcval("ref", "string"),
new xmlrpcval("id", "int"),
);
$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval($dbname, "string"));
$msg->addParam(new xmlrpcval($uid, "int"));
$msg->addParam(new xmlrpcval($password, "string"));
$msg->addParam(new xmlrpcval("res.partner", "string"));
$msg->addParam(new xmlrpcval("read", "string"));
$msg->addParam(new xmlrpcval($id_list, "array"));
$msg->addParam(new xmlrpcval($field_list, "array"));
$response = $client->send($msg);
if ($response->faultCode()){
echo $response->faultString();
}
line 170
$result = $response->value()->scalarval();
Задача ещё не решена.
Других решений пока нет …