odoo-api 0.2.5

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.
Documentation










/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L2837-L2862)
#[odoo_orm(
    method = "fields_get",
    args = ["ids"],
    kwargs = ["allfields", "attributes"],
)]
#[derive(Debug)]
pub struct FieldsGet {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    //TODO: model method, this should always be blank
    pub ids: OdooIds,

    pub allfields: Option<Vec<String>>,

    pub attributes: Option<Vec<String>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct FieldsGetResponse {}



/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L2993-L3001)
#[odoo_orm(
    method = "update_field_translations",
    args = ["ids", "field_name", "translations"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct UpdateFieldTranslations {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    //TODO: model method, this should always be blank
    pub ids: OdooIds,

    pub field_name: String,

    pub translations: Map<String, Value>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct UpdateFieldTranslationsResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L3073-L3110)
#[odoo_orm(
    method = "get_field_translations",
    args = ["ids", "field_name"],
    kwargs = ["langs"],
)]
#[derive(Debug)]
pub struct GetFieldTranslations {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    //TODO: model method, this should always be blank
    pub ids: OdooIds,

    pub field_name: String,

    pub langs: Vec<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct GetFieldTranslationsResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L3317-L3328)
#[odoo_orm(
    method = "get_base_url",
    args = ["ids"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct GetBaseUrl {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    //TODO: model method, this should always be blank
    pub ids: OdooIds,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct GetBaseUrlResponse {}






/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L4965-L4969)
#[odoo_orm(
    method = "toggle_active",
    args = ["ids"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct ToggleActive {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ToggleActiveResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L4971-L4975)
#[odoo_orm(
    method = "action_archive",
    args = ["ids"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct ActionArchive {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ActionArchiveResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L4977-L4981)
#[odoo_orm(
    method = "action_unarchive",
    args = ["ids"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct ActionUnarchive {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ActionUnarchiveResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L5371-L5483)
#[odoo_orm(
    method = "filtered_domain",
    args = ["ids", "domain"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct FilteredDomain {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,

    pub domain: Vec<Value>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct FilteredDomainResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L5485-L5504)
#[odoo_orm(
    method = "sorted",
    args = ["ids"],
    kwargs = ["key", "reverse"],
)]
#[derive(Debug)]
pub struct Sorted {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,

    pub key: String,

    pub reverse: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct SortedResponse {}

/// TBC
///
/// See: [odoo/models.py](https://github.com/odoo/odoo/blob/b6e195ccb3a6c37b0d980af159e546bdc67b1e42/odoo/models.py#L6220-L6538)
#[odoo_orm(
    method = "onchange",
    args = ["ids", "values", "field_name", "field_onchange"],
    kwargs = [],
)]
#[derive(Debug)]
pub struct Onchange {
    /// The database name (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub database: String,

    /// The user id (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub uid: OdooId,

    /// The user password (auto-filled by [`OdooClient`](crate::client::OdooClient))
    pub password: String,

    /// The Odoo model
    pub model: String,

    pub ids: OdooIds,

    pub values: Map<String, Value>,

    pub field_name: Vec<String>,

    //TODO: is this correct? test in Postman
    pub field_onchange: Map<String, Value>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct OnchangeResponse {}