This page documents how to use the manager and record objects for partner categories.
| Name | Value |
|---|---|
| Odoo Modules | Base |
| Odoo Model Name | res.partner.category |
| Manager | partner_categories |
| Record Type | PartnerCategory |
The partner category manager is available as the partner_categories
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.partner_categories.get(1234)
PartnerCategory(record={'id': 1234, ...}, fields=None)For more information on how to use managers, refer to Managers.
The partner category manager returns PartnerCategory record objects.
To import the record class for type hinting purposes:
from openstack_odooclient import PartnerCategoryThe 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: boolWhether or not this partner category is active (enabled).
child_ids: list[int]A list of IDs for the child categories.
children: list[PartnerCategory]The list of child categories.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
color: intColour index for the partner category.
colour: intAlias for color.
name: strThe name of the partner category.
Not guaranteed to be unique, even under the same parent category.
parent_id: int | NoneThe ID for the parent partner category, if this category is the child of another category.
parent_name: str | NoneThe name of the parent partner category, if this category is the child of another category.
parent: ParentCategory | NoneThe parent partner category, if this category is the child of another category.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
parent_path: str | Literal[False]The path of the parent partner category, if there is a parent.
partner_ids: list[int]A list of IDs for the partners in this category.
partners: list[Partner]The list of partners in this category.
This fetches the full records from Odoo once, and caches them for subsequent accesses.