OpenStack Referral Codes¶
This page documents how to use the manager and record objects for referral codes.
Details¶
Name | Value |
---|---|
Odoo Modules | OpenStack Integration |
Odoo Model Name | openstack.referral_code |
Manager | referral_codes |
Record Type | ReferralCode |
Manager¶
The project manager is available as the referral_codes
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.referral_codes.get(1234)
ReferralCode(record={'id': 1234, ...}, fields=None)
For more information on how to use managers, refer to Managers.
Record¶
The referral code manager returns ReferralCode
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.
allowed_uses
¶
The number of allowed uses of this referral code.
Set to -1
for unlimited uses.
before_reward_usage_threshold
¶
The amount of usage that must be recorded by the new sign-up before the reward credit is awarded to the referrer.
code
¶
The unique referral code.
name
¶
Automatically generated name for the referral code.
referral_ids
¶
A list of IDs for the partners that signed up using this referral code.
referrals
¶
The partners that signed up using this referral code.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
referral_credit_amount
¶
Initial balance for the referral credit.
referral_credit_duration
¶
Duration of the referral credit, in days.
referral_credit_type_id
¶
The ID of the credit type to use for the referral credit.
referral_credit_type_name
¶
The name of the credit type to use for the referral credit.
referral_credit_type
¶
The credit type to use for the referral credit.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
reward_credit_amount
¶
Initial balance for the reward credit.
reward_credit_duration
¶
Duration of the reward credit, in days.
reward_credit_type_id
¶
The ID of the credit type to use for the reward credit.
reward_credit_type_name
¶
The name of the credit type to use for the reward credit.
reward_credit_type
¶
The credit type to use for the reward credit.
This fetches the full record from Odoo once, and caches it for subsequent accesses.