public List <SunAccount> GetSunAccounts() { OdooCredentials creds = new OdooCredentials(); OdooApi api = new OdooApi(creds, serverCertificateValidation: false); OdooModel sunAccountModel = api.GetModel <SunAccount>(); List <SunAccount> sunAccounts = new List <SunAccount>(); List <OdooRecord> records = sunAccountModel.SearchAll(); foreach (var record in records) { var account = record.GetEntity <SunAccount>(); sunAccounts.Add(account); } return(sunAccounts); }
public OdooRecord(OdooApi api, string model, int id) { _model = model; _api = api; Id = id; }
public OdooModel(string modelName, OdooApi api) { _api = api; _modelName = modelName; }