Intechnity-com / OdooJsonRpcClient

Odoo Client Json Rpc
MIT License
68 stars 29 forks source link

Problem with table res.users #11

Closed DavidArcos07 closed 3 years ago

DavidArcos07 commented 3 years ago

I am trying to consult the information of a user from the res.users table with the administrator credentials but the Odoo Server error returns, it could help me to know what part I am doing wrong.

private readonly OdooSetting _odooSetting; private OdooClient _odooClient; private OdooConfig _config; public UserOdooService(IOptions odooSettingsAccessor) { _odooSetting = odooSettingsAccessor.Value; _config = new OdooConfig(_odooSetting.ApiURL, _odooSetting.Database, _odooSetting.Username, _odooSetting.Password);
_odooClient = new OdooClient(_config); }

    async Task<ResUsersOdooModel> IUserOdooService.GetUser(long userId)
    {
        OdooRepository<ResUsersOdooModel> repository = new OdooRepository<ResUsersOdooModel>(_config);
        var user = await repository.Query()
            .Where(w => w.Id, OdooOperator.EqualsTo, userId)
            .FirstOrDefaultAsync();

        return user.Value;
    }
patricoos commented 3 years ago

Looks good. Can U send also error message?

DavidArcos07 commented 3 years ago

The error that returns is the following: Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:

Do you know how I can change these privileges?