Example #1
0
        public List <OdooRecord> Search(int[] ids)
        {
            List <OdooRecord> records = new List <OdooRecord>();

            object[] result = _api.Read(_modelName, ids, _fields.ToArray());

            foreach (object entry in result)
            {
                XmlRpcStruct vals = (XmlRpcStruct)entry;

                int        id     = (int)vals["id"];
                OdooRecord record = new OdooRecord(_api, _modelName, id);

                foreach (string field in _fields)
                {
                    record.SetValue(field, vals[field]);
                }

                records.Add(record);
            }

            return(records);
        }
Example #2
0
 public void Save(OdooRecord record)
 {
     Save(new List <OdooRecord> {
         record
     });
 }
Example #3
0
 public void Remove(OdooRecord record)
 {
     Remove(new List <OdooRecord> {
         record
     });
 }