Skip to content

Users

This page documents how to use the manager and record objects for users.

Details

Name Value
Odoo Modules Base, Accounting
Odoo Model Name res.users
Manager users
Record Type User

Manager

The user manager is available as the users attribute on the Odoo client object.

>>> from openstack_odooclient import Client as OdooClient
>>> odoo_client = OdooClient(
...     hostname="localhost",
...     port=8069,
...     protocol="jsonrpc",
...     database="odoodb",
...     user="test-user",
...     password="<password>",
... )
>>> odoo_client.users.get(1234)
User(record={'id': 1234, ...}, fields=None)

For more information on how to use managers, refer to Managers.

Record

The user manager returns User record objects.

To import the record class for type hinting purposes:

from openstack_odooclient import User

The record class currently implements the following fields and methods.

For more information on attributes and methods common to all record types, see Record Attributes and Methods.

active

active: bool

Whether or not this user is active (enabled).

active_partner

active_partner: bool

Whether or not the partner this user is associated with is active.

company_id

company_id: int

The ID for the default company this user is logged in as.

company_name

company_name: str

The name of the default company this user is logged in as.

company

company: Company

The default company this user is logged in as.

This fetches the full record from Odoo once, and caches it for subsequent accesses.

name

name: str

User name.

partner_id

partner_id: int

The ID for the partner that this user is associated with.

partner_name

partner_name: str

The name of the partner that this user is associated with.

partner

partner: Partner

The partner that this user is associated with.

This fetches the full record from Odoo once, and caches it for subsequent accesses.