Exemplo n.º 1
0
 public void Remove(OdooRecord record)
 {
     Remove(new List <OdooRecord>()
     {
         record
     });
 }
Exemplo n.º 2
0
 public void Save(OdooRecord record)
 {
     Save(new List <OdooRecord>()
     {
         record
     });
 }
Exemplo n.º 3
0
        public List <OdooRecord> Search(object[] filter)
        {
            List <OdooRecord> records = new List <OdooRecord>();

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

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

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

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

                records.Add(record);
            }

            return(records);
        }