Skip to content

tuhut/OdooXmlRpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OdooXmlRpc .Net

Description

XmlRpc Web Service Client .NET is a C# implementation of XML-RPC, a popular protocol that uses XML over HTTP to implement remote procedure calls. This implementation can be used in .NET 4.6 This software was tested with Odoo ERP 8 and 11

Features

Links

Example Query HR.EMPLOYEE

  • Source:
using Microsoft.Extensions.Configuration;
using Odoo.Concrete;
using System;
using System.Collections.Generic;
using System.Linq;
using Odoo.Entensions;

namespace OdooSample
{
    class Program
    {
        private static readonly IServiceProvider ServiceProvider;

        static void Main(string[] args)
        {
            IConfiguration config = new ConfigurationBuilder()
                .AddJsonFile("appsettings.json", true, true)
                .Build();

            var rpcConnnectionSettings = new RpcConnectionSetting();
            config.GetSection("OdooConnection").Bind(rpcConnnectionSettings);

            var odooConn = new RpcConnection(rpcConnnectionSettings);


            var rpcContext = new RpcContext(odooConn, "hr.employee");

            rpcContext
                .RpcFilter.NotEqual("image_medium", false);

            rpcContext
                .AddField("id")
                .AddField("image_medium");              

            var data = rpcContext.Execute(true);


            foreach (var record in data.ToList())
            {                
                var image = "";
                if (!(bool) record.GetValue("image_medium"))
                {
                  image = record.GetValue("image_medium").ToString();
                }
                
                if (image.Length <= 0) continue;
                var id = record.GetValue("id").ToString();
            }
            Console.ReadLine();
        }
    }
}

About

Odoo xmlrpc library for .Net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%