pub struct Read {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub ids: OdooIds,
pub fields: Vec<String>,
}Expand description
Read data from a record (or set of records)
§Example
// read from a single record
let resp = client.read(
"res.partner",
1,
svec!["id", "login"]
).send()?;
// read from multiple records
let resp = client.read(
"res.partner",
vec![1, 2, 3],
svec!["id", "login"]
).send()?;
println!("Data: {:?}", resp.data);See: odoo/models.py
Fields§
§database: StringThe database name (auto-filled by OdooClient)
uid: OdooIdThe user id (auto-filled by OdooClient)
password: StringThe user password (auto-filled by OdooClient)
model: StringThe Odoo model
ids: OdooIdsThe records
fields: Vec<String>The fields to be fetched
Trait Implementations§
Source§impl JsonRpcParams for Read
impl JsonRpcParams for Read
type Container<T> = OdooOrmContainer<Read>
type Response = ReadResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for Read
impl OdooOrmMethod for Read
Source§fn endpoint(&self) -> &'static str
fn endpoint(&self) -> &'static str
Describe the “ORM” method endpoint (e.g., “/web/session/authenticate”)
Source§fn method(&self) -> &'static str
fn method(&self) -> &'static str
Return the model method name (e.g., “read_group” or “create”)
Source§fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Build
self into a full JsonRpcRequestAuto Trait Implementations§
impl Freeze for Read
impl RefUnwindSafe for Read
impl Send for Read
impl Sync for Read
impl Unpin for Read
impl UnwindSafe for Read
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more