pub struct NameSearch {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub name: String,
pub args: Option<Vec<Value>>,
pub operator: Option<String>,
pub limit: Option<u32>,
}
Expand description
Search for records based on their name
field
This is a shortcut to the search()
method with only one domain component:
[("name", "ilike", name)]
. This function is generally used by the Odoo searchbar,
and by the search function on x2many fields.
Note: Some models may override this method to provide custom “name search” behaviour.
§Example
client.name_search(
"res.partner",
"Admini%".into(),
None,
None,
None,
).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
name: String
The name to search for (can include operators like %
)
args: Option<Vec<Value>>
An optional search domain
operator: Option<String>
A domain operator for the “name test”
For example:
ilike
(default)=
- …etc
limit: Option<u32>
Limit the number of results
Trait Implementations§
Source§impl Debug for NameSearch
impl Debug for NameSearch
Source§impl JsonRpcParams for NameSearch
impl JsonRpcParams for NameSearch
type Container<T> = OdooOrmContainer<NameSearch>
type Response = NameSearchResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for NameSearch
impl OdooOrmMethod for NameSearch
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 JsonRpcRequest
Auto Trait Implementations§
impl Freeze for NameSearch
impl RefUnwindSafe for NameSearch
impl Send for NameSearch
impl Sync for NameSearch
impl Unpin for NameSearch
impl UnwindSafe for NameSearch
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