OpenStack Grants¶
This page documents how to use the manager and record objects for grants.
Details¶
Name | Value |
---|---|
Odoo Modules | OpenStack Integration |
Odoo Model Name | openstack.grant |
Manager | grants |
Record Type | Grant |
Manager¶
The grant manager is available as the grants
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.grants.get(1234)
Grant(record={'id': 1234, ...}, fields=None)
For more information on how to use managers, refer to Managers.
Record¶
The grant manager returns Grant
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.
expiry_date
¶
The date the grant expires.
grant_type_id
¶
The ID of the type of this grant.
grant_type_name
¶
The name of the type of this grant.
grant_type
¶
The type of this grant.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
name
¶
The automatically generated name of the grant.
start_date
¶
The start date of the grant.
value
¶
The value of this grant.
voucher_code_id
¶
The ID of the voucher code used when applying for the grant, if one was supplied.
voucher_code_name
¶
The name of the voucher code used when applying for the grant, if one was supplied.
voucher_code
¶
The voucher code used when applying for the grant, if one was supplied.
This fetches the full record from Odoo once, and caches it for subsequent accesses.