-
Notifications
You must be signed in to change notification settings - Fork 16
Description
my code is this
`var Odoo = require('../lib/index');
var odoo = new Odoo({
host: '1.2.3.4',
port: 1234,
database: 'abc',
username: 'admin',
password: 'admin'
});
// Connect to Odoo
odoo.connect(function (err) {
if (err) {
return console.log(err);
}
// Get a partner
var params = {
ids: [1, 2, 3, 4],
fields: ['name', 'street', 'city', 'email']
};
odoo.get('res.partner', params,
function (err, partner) {
if (err) {
return console.log(err);
}
console.log('Partner', partner);
});
});
`
when I use localhost:8070 for this code, it works fine, but for this ip it gives me this error
{ message: 'Odoo Server Error', code: 200, data: { debug: 'Traceback (most recent call last):\n File "/opt/odoo8/odoo/opener /http.py", line 540, in _handle_exception\n return super(JsonRequest, self). handle_exception(exception)\n File "/opt/odoo8/odoo/openerp/http.py", line 577 in dispatch\n result = self._call_function(**self.params)\n File "/opt/odo 8/odoo/openerp/http.py", line 313, in _call_function\n return checked_call(s lf.db, *args, **kwargs)\n File "/opt/odoo8/odoo/openerp/service/model.py", lin 118, in wrapper\n return f(dbname, *args, **kwargs)\n File "/opt/odoo8/odo /openerp/http.py", line 310, in checked_call\n return self.endpoint(*a, **kw \n File "/opt/odoo8/odoo/openerp/http.py", line 806, in __call__\n return s lf.method(*args, **kw)\n File "/opt/odoo8/odoo/openerp/http.py", line 406, in esponse_wrap\n response = f(*args, **kw)\n File "/opt/odoo8/odoo/addons/web controllers/main.py", line 944, in call_kw\n return self._call_kw(model, met od, args, kwargs)\n File "/opt/odoo8/odoo/addons/web/controllers/main.py", lin 936, in _call_kw\n return getattr(request.registry.get(model), method)(requ st.cr, request.uid, *args, **kwargs)\n File "/opt/odoo8/odoo/openerp/api.py", ine 268, in wrapper\n return old_api(self, *args, **kwargs)\n File "/opt/od o8/odoo/openerp/models.py", line 3144, in read\n result = BaseModel.read(rec rds, fields, load=load)\n File "/opt/odoo8/odoo/openerp/api.py", line 266, in rapper\n return new_api(self, *args, **kwargs)\n File "/opt/odoo8/odoo/open rp/models.py", line 3162, in read\n self.check_access_rights(\'read\')\n Fi e "/opt/odoo8/odoo/openerp/api.py", line 266, in wrapper\n return new_api(se f, *args, **kwargs)\n File "/opt/odoo8/odoo/openerp/api.py", line 487, in new_ pi\n result = method(self._model, cr, uid, *args, **kwargs)\n File "/opt/od o8/odoo/openerp/models.py", line 3505, in check_access_rights\n return self. ool.get(\'ir.model.access\').check(cr, uid, self._name, operation, raise_except on)\n File "/opt/odoo8/odoo/openerp/api.py", line 268, in wrapper\n return ld_api(self, *args, **kwargs)\n File "<decorator-gen-2>", line 2, in check\n ile "/opt/odoo8/odoo/openerp/tools/cache.py", line 122, in lookup\n value = [key] = self.method(*args, **kwargs)\n File "/opt/odoo8/odoo/openerp/addons/ba e/ir/ir_model.py", line 769, in check\n raise openerp.exceptions.AccessError msg % msg_params)\nAccessError: (\'AccessError\', u\'Sorry, you are not allowed to access this document. Only users with the following access level are current y allowed to do that:\\n- Public\\n\\t- Portal\\n\\t- Other/Contact Creation (M mber)\\n\\t- Other/Contact Creation (Team Leader)\\n\\t- Knowledge/User\\n\\t- roject/User\\n\\n(Document model: res.partner)\')\n', exception_type: 'except_osv', message: 'AccessError\nSorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Public\n\t- Portal\n\t- Other/Contact Creation (Member)\n\t- Other/Contact Crea ion (Team Leader)\n\t- Knowledge/User\n\t- Project/User\n\n(Document model: res partner)', name: 'openerp.exceptions.AccessError', arguments: [ 'AccessError', 'Sorry, you are not allowed to access this document. Only users with th following access level are currently allowed to do that:\n- Public\n\t- Portal n\t- Other/Contact Creation (Member)\n\t- Other/Contact Creation (Team Leader)\ \t- Knowledge/User\n\t- Project/User\n\n(Document model: res.partner)' ] } }
is there any solution for this?