pub struct Create {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub values: CreateVals,
}Expand description
Create a new record (or set of records)
§Example
// create a single record
let resp = client.create(
"res.partner",
jmap!{
"name": "Example Partner",
"email": "hello@example.com"
}
).send()?;
// create multiple records
let resp2 = client.create(
"res.partner",
jvec![
{"name": "Partner #1", "email": "marco@example.com"},
{"name": "Partner #2", "email": "polo@example.com"}
]
).send()?;
println!("New partner ids: {:?}", resp2.ids);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
values: CreateValsValues for the new record(s)
Trait Implementations§
Source§impl JsonRpcParams for Create
impl JsonRpcParams for Create
type Container<T> = OdooOrmContainer<Create>
type Response = CreateResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for Create
impl OdooOrmMethod for Create
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 Create
impl RefUnwindSafe for Create
impl Send for Create
impl Sync for Create
impl Unpin for Create
impl UnwindSafe for Create
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