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: 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
values: CreateVals
Values 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 JsonRpcRequest
Auto 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