diff --git a/README.md b/README.md index 96f5be9..4617da4 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,9 @@ let mut client = client.authenticate( let users = client.execute( "res.users", "search", - jvec![] + jvec![ + [["active", "=", true], ["login", "!=", "__system__"]] + ] ).send().await?; // fetch the login and partner_id fields from user id=1 diff --git a/odoo-api/Cargo.toml b/odoo-api/Cargo.toml index f119156..40f7d7e 100644 --- a/odoo-api/Cargo.toml +++ b/odoo-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "odoo-api" -version = "0.2.5" +version = "0.2.6" authors = ["Ryan Cole "] description = "Type-safe and full-coverage implementation of the Odoo JSON-RPC API, including ORM and Web methods. Supports sessioning, multi-database, async and blocking via reqwest, and bring-your-own requests." repository = "https://github.com/ryanc-me/odoo-api-rs" diff --git a/odoo-api/README.md b/odoo-api/README.md index 96f5be9..4617da4 100644 --- a/odoo-api/README.md +++ b/odoo-api/README.md @@ -76,7 +76,9 @@ let mut client = client.authenticate( let users = client.execute( "res.users", "search", - jvec![] + jvec![ + [["active", "=", true], ["login", "!=", "__system__"]] + ] ).send().await?; // fetch the login and partner_id fields from user id=1 diff --git a/odoo-api/src/lib.rs b/odoo-api/src/lib.rs index 9f91645..508b06f 100644 --- a/odoo-api/src/lib.rs +++ b/odoo-api/src/lib.rs @@ -72,7 +72,9 @@ //! let users = client.execute( //! "res.users", //! "search", -//! jvec![] +//! jvec![ +//! [["active", "=", true], ["login", "!=", "__system__"]] +//! ] //! ).send().await?; //! //! // fetch the login and partner_id fields from user id=1 diff --git a/odoo-api/src/service/object.rs b/odoo-api/src/service/object.rs index e47264a..daede38 100644 --- a/odoo-api/src/service/object.rs +++ b/odoo-api/src/service/object.rs @@ -62,7 +62,8 @@ use serde_tuple::Serialize_tuple; /// /// For example, consider the Python function /// ```python -/// def search_read(domain, fields=None): +/// @api.model +/// def search_read(self, domain, fields=None): /// pass /// ``` /// @@ -82,8 +83,11 @@ use serde_tuple::Serialize_tuple; /// ///
/// -/// Also note that many Odoo methods accept `self` as the first param. In that -/// case, you should pass a list of IDs as the first element. +/// Also note that many Odoo methods accept `self` as the first param - generaly +/// methods who are decorated with `@api.multi`, or do not have a decoration. +/// In that case, you should pass a list of IDs as the first element. Methods that +/// have the `@api.model` decoration are a notable exception - for those methods, +/// you should not pass anything for the `self` arg. /// /// See: [odoo/service/model.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/service/model.py#L62-L68) #[odoo_api(service = "object", method = "execute", auth = true)]