OpenStack Credit Types¶
This page documents how to use the manager and record objects for credit types.
Details¶
| Name | Value | 
|---|---|
| Odoo Modules | OpenStack Integration | 
| Odoo Model Name | openstack.credit.type | 
| Manager | credit_types | 
| Record Type | CreditType | 
Manager¶
The credit type manager is available as the credit_types
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.credit_types.get(1234)
CreditType(record={'id': 1234, ...}, fields=None)
For more information on how to use managers, refer to Managers.
Record¶
The credit type manager returns CreditType 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.
credit_ids¶
A list of IDs for the credits which are of this credit type.
credits¶
A list of credits which are of this credit type.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
name¶
Name of the Credit Type.
only_for_product_ids¶
A list of IDs for the products this credit applies to.
Mutually exclusive with
only_for_product_category_ids/only_for_product_categories.
If none of these values are specified, the credit applies to all products.
only_for_products¶
A list of products which this credit applies to.
Mutually exclusive with
only_for_product_category_ids/only_for_product_categories.
If none of these values are specified, the credit applies to all products.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
only_for_product_category_ids¶
A list of IDs for the product categories this credit applies to.
Mutually exclusive with
only_for_product_ids/only_for_products.
If none of these values are specified, the credit applies to all products.
only_for_product_categories¶
A list of product categories which this credit applies to.
Mutually exclusive with
only_for_product_ids/only_for_products.
If none of these values are specified, the credit applies to all products.
This fetches the full records from Odoo once, and caches them for subsequent accesses.
product_id¶
The ID of the product to use when applying the credit to invoices.
product_name¶
The name of the product to use when applying the credit to invoices.
product¶
The product to use when applying the credit to invoices.
This fetches the full record from Odoo once, and caches it for subsequent accesses.
refundable¶
Whether or not the credit is refundable.