OpenStack Term Discounts¶
This page documents how to use the manager and record objects for term discounts.
Details¶
Name | Value |
---|---|
Odoo Modules | OpenStack Integration |
Odoo Model Name | openstack.term_discount |
Manager | term_discounts |
Record Type | TermDiscount |
Manager¶
The term discount manager is available as the term_discounts
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.term_discounts.get(1234)
TermDiscount(record={'id': 1234, ...}, fields=None)
For more information on how to use managers, refer to Managers.
Record¶
The term discount manager returns TermDiscount
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.
discount_percent
¶
The maximum discount percentage for this term discount (0-100).
early_termination_date
¶
An optional early termination date for the term discount.
end_date
¶
The date that the term discount expires on.
min_commit
¶
The minimum commitment for this term discount to apply.
partner_id
¶
The ID for the partner that receives this term discount.
partner_name
¶
The name of the partner that receives this term discount.
partner
¶
The partner that receives this term discount.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
project_id
¶
The ID for the project this term discount applies to, if it is a project-specific term discount.
If not set, the term discount applies to all projects the partner owns.
project_name
¶
The name of the project this term discount applies to, if it is a project-specific term discount.
If not set, the term discount applies to all projects the partner owns.
project
¶
The project this term discount applies to, if it is a project-specific term discount.
If not set, the term discount applies to all projects the partner owns.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
start_date
¶
The date from which this term discount starts.
superseded_by_id
¶
The ID for the term discount that supersedes this one, if superseded.
superseded_by_name
¶
The name of the term discount that supersedes this one, if superseded.
superseded_by
¶
The term discount that supersedes this one, if superseded.
This fetches the full record from Odoo once, and caches it for subsequent accesses.