pub struct ReadGroup {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub domain: Vec<Value>,
pub fields: Vec<String>,
pub groupby: Vec<String>,
pub offset: Option<u32>,
pub limit: Option<u32>,
pub orderby: Option<String>,
pub lazy: bool,
}
Expand description
Read some grouped data from a record (or set of records)
§Example
client.read_group(
"res.partner",
// domain
jvec![
["email", "=ilike", "%@example.com"],
["phone", "!=", false]
],
// fields
svec!["id", "name", "email", "phone"],
// groupby
svec!["create_date:month", "email"],
Some(0), // offset
Some(10), // limit
Some("create_date desc".into()), // orderby
false // lazy
).send()?;
See: odoo/models.py
Fields§
§database: String
The database name (auto-filled by OdooClient
)
uid: OdooId
The user id (auto-filled by OdooClient
)
password: String
The user password (auto-filled by OdooClient
)
model: String
The Odoo model
domain: Vec<Value>
The domain to search on
fields: Vec<String>
The fields to read
groupby: Vec<String>
The groupby descriptions
See read_group
for more information.
offset: Option<u32>
An optional offset, for paging
limit: Option<u32>
An optional limit
orderby: Option<String>
An optional ordering description
This corresponds roughly with PostgreSQL’s ORDER BY
clause, for example:
create_date desc, id asc, active asc
lazy: bool
Enable lazy-grouping
If true
, then only the first groupby
fragment is evaluated, and all
other fragments are added to the __context
key in the response.
This may be useful when initially showing a list of top-level groups; evaluating
only the first groupby
will be much faster for large datasets.
Trait Implementations§
Source§impl JsonRpcParams for ReadGroup
impl JsonRpcParams for ReadGroup
type Container<T> = OdooOrmContainer<ReadGroup>
type Response = ReadGroupResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for ReadGroup
impl OdooOrmMethod for ReadGroup
Source§fn endpoint(&self) -> &'static str
fn endpoint(&self) -> &'static str
Source§fn method(&self) -> &'static str
fn method(&self) -> &'static str
Source§fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
self
into a full JsonRpcRequest