pub struct Write {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub ids: OdooIds,
pub values: Map<String, Value>,
}Expand description
Write data to a record (or set of records)
§Example
// write to a single record
client.write(
"res.partner",
1,
jmap!{
"name": "New Partner Name"
}
).send()?;
// write to multiple records
client.write(
"res.partner",
vec![1, 2, 3],
jmap!{
"website": "https://www.example.com"
}
).send()?;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
values: Map<String, Value>The values to write
Trait Implementations§
Source§impl JsonRpcParams for Write
impl JsonRpcParams for Write
type Container<T> = OdooOrmContainer<Write>
type Response = WriteResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for Write
impl OdooOrmMethod for Write
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 Write
impl RefUnwindSafe for Write
impl Send for Write
impl Sync for Write
impl Unpin for Write
impl UnwindSafe for Write
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