pub fn execute(
db: &str,
uid: u32,
password: &str,
model: &str,
method: &str,
args: Value
) -> Result<OdooApiRequest<Execute>>
Expand description
Call a business-logic method on an Odoo model (positional args)
Service: object
Method: execute
Request: Execute
Response: ExecuteResponse
This method allows you to call an arbitrary Odoo method (e.g. read
or
create
or my_function
), passing some arbitrary data, and returns the
result of that method call.
Note that this method does not support keyword args. If you need to pass
kwargs, see ExecuteKw
and execute_kw
.
Example:
use odoo_api::types::object;
use serde_json::json;
let request = object::execute(
"my-database",
1, // admin user
"password1",
"res.users",
"read",
json!([
[1, 2, 3],
["name", "login"]
])
);