Ejemplo n.º 1
0
        public OdooApi(OdooCredentials credentials, bool immediateLogin = true, WebProxy networkProxy = null,
                       bool serverCertificateValidation = true)
        {
            _serverCertificateValidation = serverCertificateValidation;
            _networkProxy = networkProxy;
            _credentials  = credentials;

            if (immediateLogin)
            {
                Login();
            }
        }
Ejemplo n.º 2
0
        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);
        }