【问题标题】:OpenERP Create Method returns Access Denied errorOpenERP 创建方法返回拒绝访问错误
【发布时间】:2013-01-10 05:00:35
【问题描述】:

您好,我是 OpenERP 的新手,当我尝试使用 PHP 中的 Create Method 在 Open ERP 中插入记录时,它返回错误 Access denied。 以下是我的插入代码:

<?php

include('xmlrpc.inc');

$arrayVal = array(
'name'=>new xmlrpcval('Fabien Pinckaers', "string") ,
'vat'=>new xmlrpcval('BE477472701' , "string")
);

$client = new xmlrpc_client("http://107.23.27.60:8069/xmlrpc/object");

$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval("test_sys", "string"));
$msg->addParam(new xmlrpcval("1", "int"));
$msg->addParam(new xmlrpcval("demo", "string"));
$msg->addParam(new xmlrpcval("res.partner", "string"));
$msg->addParam(new xmlrpcval("create", "string"));
$msg->addParam(new xmlrpcval($arrayVal, "struct"));

$resp = $client->send($msg);

if ($resp->faultCode())

echo 'Error: '.$resp->faultString();

else

echo 'Partner '.$resp->value()->scalarval().' created !';

?>

在上面的代码中 test_sys 是数据库名称,1 是我的用户 ID。 以下是输出:

xmlrpcresp Object
(
[val] => 0
[valtyp] => 
[errno] => -1
[errstr] => Access denied.
[payload] => 
[hdrs] => Array
    (
        [content-type] => text/xml
        [content-length] => 286
        [server] => Werkzeug/0.8.3 Python/2.7.3
        [date] => Thu, 10 Jan 2013 04:29:55 GMT
    )

[_cookies] => Array
    (
    )

[content_type] => text/xml
[raw_data] => HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 286
Server: Werkzeug/0.8.3 Python/2.7.3
Date: Thu, 10 Jan 2013 04:29:55 GMT

faultCode
AccessDenied


faultString
Access denied.

)

【问题讨论】:

    标签: php openerp


    【解决方案1】:

    请检查您用于创建res.partner 记录的用户的权限。

    我认为您正在使用demo 用户和demo 用户没有创建res.partner 记录的权限。

    如果要添加demo用户的记录,请在demo的权限中添加create权限。

    【讨论】:

    • 非常感谢它有效,我使用的是演示用户,第二件事是我传递参数值演示它应该是用户密码而不是用户名。 @库马尔
    【解决方案2】:

    我有这样的错误 因为用户名或密码错误

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 2018-01-31
      • 2015-06-25
      • 1970-01-01
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 2019-11-25
      • 1970-01-01
      相关资源
      最近更新 更多