Companies¶
This page documents how to use the manager and record objects for companies.
Details¶
Name | Value |
---|---|
Odoo Modules | Base, Product, Sales |
Odoo Model Name | res.company |
Manager | companies |
Record Type | Company |
Manager¶
The company manager is available as the companies
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.companies.get(1234)
Company(record={'id': 1234, ...}, fields=None)
For more information on how to use managers, refer to Managers.
Record¶
The company manager returns Company
record objects.
To import the record class for type hinting purposes:
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
¶
Whether or not this company is active (enabled).
child_ids
¶
A list of IDs for the child companies.
children
¶
The list of child companies.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
name
¶
Company name, set from the partner name.
parent_id
¶
The ID for the parent company, if this company is the child of another company.
parent_name
¶
The name of the parent company, if this company is the child of another company.
parent
¶
The parent company, if this company is the child of another company.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
parent_path
¶
The path of the parent company, if there is a parent.
partner_id
¶
The ID for the partner for the company.
partner_name
¶
The name of the partner for the company.
partner
¶
The partner for the company.
This fetches the full record from Odoo once, and caches it for subsequent accesses.