Thanks Nilmar,
Below is my code:
OdooAPI api = new OdooAPI(creds);
OdooModel productmodel = api.GetModel("product.template");
object[] filter = new object[1];
filter[0] = new object[3] { "name", "!=", null};
List<OdooRecord> records = productmodel.Search(filter);
foreach (OdooRecord record in records)
{
listBox1.Items.Add(String.Format("[{0}] {1} {2}", record.GetValue("cost"), record.GetValue("product_code"), record.GetValue("name")));
}
What I am getting is [] for the three products.
Thanks,
VIkram
Hello Nilmar,
How do I do what you are asking me? (console the product records). This is what I get on Console:
System.Collections.Generic.List`1[OdooRpcWrapper.OdooRecord]
OK Got it.
I had missed this line in my program:
productModel.AddField("name");
productModel.AddField("default_code");
It is only then that you can retrieve these fields.
Thanks a lot.