Intechnity-com / OdooJsonRpcClient

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

Odoo 17 - Error Get Sales Teams (CrmTeamOdooModel) External API C# #101

Open jseoaneChecksum opened 1 month ago

jseoaneChecksum commented 1 month ago

I have a problem wanting to obtain the sales teams through the external API. I get the model (CrmTeamOdooModel) and create the class, but when doing the query to bring in the sales teams I get the following error: {Odoo Server Error, Undefined graphical model for the sales team: Sales}

public async Task<OdooResult<CrmTeamOdooModel[]>> GetCrmTeams()
{
    try
    {
        var odooClient = await StartClientOdoo();
        var repository = new OdooRepository<CrmTeamOdooModel>(config);

        var crmTeams = await repository.Query().ToListAsync(); //Error  {Odoo Server Error, Undefined graphical model for the sales team: Sales}

        if (crmTeams .Error is not null)
        {
            throw new Exception(crmTeams .Error.ToString());
        }

        return crmTeams ;
    }
    catch (Exception)
    {
        throw;
    }
}