Skip to content

Partners

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

Details

Name Value
Odoo Modules Base, Product, Sales, OpenStack Integration
Odoo Model Name res.partner
Manager partners
Record Type Partner

Manager

The partner manager is available as the partners 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.partners.get(1234)
Partner(record={'id': 1234, ...}, fields=None)

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

Record

The partner manager returns Partner record objects.

To import the record class for type hinting purposes:

from openstack_odooclient import Partner

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 partner is active (enabled).

company_id

company_id: int

The ID for the company this partner is owned by.

company_name

company_name: str

The name of the company this partner is owned by.

company

company: Company

The company this partner is owned by.

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

email

email: str

Main e-mail address for the partner.

name

name: str

Full name of the partner.

os_customer_group_id

os_customer_group_id: int | None

The ID for the customer group this partner is part of, if it is part of one.

os_customer_group_name

os_customer_group_name: str | None

The name of the customer group this partner is part of, if it is part of one.

os_customer_group

os_customer_group: CustomerGroup

The customer group this partner is part of, if it is part of one.

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

os_project_ids

os_project_ids: list[int]

A list of IDs for the OpenStack projects that belong to this partner.

os_projects

os_projects: list[project.Project]

The OpenStack projects that belong to this partner.

This fetches the full records from Odoo once, and caches them for subsequent accesses.

os_project_contact_ids

os_project_contact_ids: list[int]

A list of IDs for the project contacts that are associated with this partner.

os_project_contacts

os_project_contacts: list[ProjectContact]

The project contacts that are associated with this partner.

This fetches the full records from Odoo once, and caches them for subsequent accesses.

os_referral_id

os_referral_id: int | None

The ID for the referral code the partner used on sign-up, if one was used.

os_referral_name

os_referral_name: str | None

The name of the referral code the partner used on sign-up, if one was used.

os_referral

os_referral: ReferralCode

The referral code the partner used on sign-up, if one was used.

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

os_referral_code_ids

os_referral_code_ids: list[int]

A list of IDs for the referral codes the partner has used.

os_referral_codes

os_referral_codes: list[ReferralCode]

The referral codes the partner has used.

This fetches the full records from Odoo once, and caches them for subsequent accesses.

os_reseller_id

os_reseller_id: int | None

The ID for the reseller for this partner, if this partner is billed through a reseller.

os_reseller_name

os_reseller_name: str | None

The name of the reseller for this partner, if this partner is billed through a reseller.

os_reseller

os_reseller: Reseller | None

The reseller for this partner, if this partner is billed through a reseller.

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

os_trial_id

os_trial_id: int | None

The ID for the sign-up trial for this partner, if signed up under a trial.

os_trial_name

os_trial_name: str | None

The name of the sign-up trial for this partner, if signed up under a trial.

os_trial

os_trial: Trial | None

The sign-up trial for this partner, if signed up under a trial.

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

parent_id

parent_id: int | None

The ID for the parent partner of this partner, if it has a parent.

parent_name

parent_name: str | None

The name of the parent partner of this partner, if it has a parent.

parent

parent: Partner | None

The parent partner of this partner, if it has a parent.

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

property_product_pricelist_id

property_product_pricelist_id: int | None

The ID for the pricelist this partner uses, if explicitly set.

If not set, the pricelist set for the customer group is used (and if that is not set, the global default pricelist is used).

property_product_pricelist_name

property_product_pricelist_name: str | None

The name of the pricelist this partner uses, if explicitly set.

If not set, the pricelist set for the customer group is used (and if that is not set, the global default pricelist is used).

property_product_pricelist

property_product_pricelist: Pricelist | None

The pricelist this partner uses, if explicitly set.

If not set, the pricelist set for the customer group is used (and if that is not set, the global default pricelist is used).

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

stripe_customer_id

stripe_customer_id: str | Literal[False]

Stripe customer ID for this partner, if one has been assigned.

user_id

user_id: int | None

The ID of the internal user associated with this partner, if one is assigned.

user_name

user_name: str | None

The name of the internal user associated with this partner, if one is assigned.

user

user: User | None

The internal user associated with this partner, if one is assigned.

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