Closed akira32chen closed 2 years ago
A example will be clear enough? `-------------------------------------------------------------------------------------------- var client = new XmlRpcClient(); client.Url = Url; // https://odoo.whatever.com:443/xmlrpc/2 client.Path = "object";
var restrito = XmlRpcParameter.AsArray(
XmlRpcParameter.AsArray(
XmlRpcParameter.AsArray("is_company", "=", true),
XmlRpcParameter.AsArray("is_blacklisted", "=", true)
// customer doesn't exist Maybe "company_type" = "person"
));
// Really restrito is a List<object>(){ List<object>() { ... }}
// and every restriction is List<object> with 3 items,
// field name, string with a operator and filter value.
var modif = XmlRpcParameter.AsStruct(
XmlRpcParameter.AsMember("fields",
XmlRpcParameter.AsArray("name", "country_id", "comment")),
XmlRpcParameter.AsMember("limit", 5)
);
// Really modif is a Dictionary<string,object>
// and fields is a List<object>() { ... } and limit a [key, value]
XmlRpcRequest requestSearch = new XmlRpcRequest("execute_kw");
requestSearch.AddParams(db, uid, password, "res.partner", "search_read",
restrito, modif );
var responseSearch = client.Execute(requestSearch);
var str = responseSearch.GetString();
`
thanks @fjarboleda-lm
I want to reach this goal as below: Could somebody know how to write by using C#?