我是初学者,知道在Odoo for Android中的API网络服务。我按照此文档https://www.odoo.com/documentation/8.0/api_integration.html.
进行操作,因此我创建了此代码:
<?php
require_once('ripcord-master/ripcord.php');
$url = "http://100.100.1.148:8069"; //local IP
$db = "UAT_DISTRICT";
$username = "openpg";
$password = "serving";
$info = ripcord::client('https://demo.odoo.com/start')->start();
$common = ripcord::client("$url/xmlrpc/2/common");
$common->version();
//Authenticate the credentials
$uid = $common->authenticate($db, $username, $password, array());
echo $uid; //this echo doesn't show anything, it should be 1 or 0
然后我尝试更改代码,就像这个链接Get values from method in Odoo 8 API的第一个答案一样,我只是得到了这个错误:
Array ( [faultCode] => 1 [faultString] => Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\service\wsgi_server.py", line 75, in xmlrpc_return File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\http.py", line 115, in dispatch_rpc File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\service\model.py", line 34, in dispatch File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\service\security.py", line 37, in check File "C:\Program Files (x86)\Odoo 8.0-20150723\server\openerp\addons\base\res\res_users.py", line 502, in check File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\api.py", line 241, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20150723\server\openerp\addons\auth_crypt\auth_crypt.py", line 50, in check_credentials File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\sql_db.py", line 158, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20150723\server\.\openerp\sql_db.py", line 234, in execute ProgrammingError: operator does not exist: integer = boolean LINE 1: ...T password, password_crypt FROM res_users WHERE id=false AND... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. )
然后我也从某个网站上搜索,但到目前为止我什么都没得到。任何人都可以解决我的问题?或者有更好的文档/示例,我将非常感激。
答案 0 :(得分:1)
您需要更改以下内容: $ info = ripcord :: client('https://demo.odoo.com/start') - &gt; start();
使用您的IP地址代替“https://demo.odoo.com”