|
| 1 | +# Fiscal Positions |
| 2 | + |
| 3 | +*Added in version 0.2.4.* |
| 4 | + |
| 5 | +This page documents how to use the manager and record objects |
| 6 | +for fiscal positions. |
| 7 | + |
| 8 | +## Details |
| 9 | + |
| 10 | +| Name | Value | |
| 11 | +|-----------------|---------------------------| |
| 12 | +| Odoo Modules | Accounting, Point of Sale | |
| 13 | +| Odoo Model Name | `account.fiscal.position` | |
| 14 | +| Manager | `fiscal_positions` | |
| 15 | +| Record Type | `FiscalPosition` | |
| 16 | + |
| 17 | +## Manager |
| 18 | + |
| 19 | +The customer group manager is available as the `fiscal_positions` |
| 20 | +attribute on the Odoo client object. |
| 21 | + |
| 22 | +```python |
| 23 | +>>> from openstack_odooclient import Client as OdooClient |
| 24 | +>>> odoo_client = OdooClient( |
| 25 | +... hostname="localhost", |
| 26 | +... port=8069, |
| 27 | +... protocol="jsonrpc", |
| 28 | +... database="odoodb", |
| 29 | +... user="test-user", |
| 30 | +... password="<password>", |
| 31 | +... ) |
| 32 | +>>> odoo_client.fiscal_positions.get(1234) |
| 33 | +FiscalPosition(record={'id': 1234, ...}, fields=None) |
| 34 | +``` |
| 35 | + |
| 36 | +For more information on how to use managers, refer to [Managers](index.md). |
| 37 | + |
| 38 | +## Record |
| 39 | + |
| 40 | +The customer group manager returns `FiscalPosition` record objects. |
| 41 | + |
| 42 | +To import the record class for type hinting purposes: |
| 43 | + |
| 44 | +```python |
| 45 | +from openstack_odooclient import FiscalPosition |
| 46 | +``` |
| 47 | + |
| 48 | +The record class currently implements the following fields and methods. |
| 49 | + |
| 50 | +For more information on attributes and methods common to all record types, |
| 51 | +see [Record Attributes and Methods](index.md#attributes-and-methods). |
| 52 | + |
| 53 | + |
| 54 | +### `active` |
| 55 | + |
| 56 | +```python |
| 57 | + active: bool |
| 58 | +``` |
| 59 | + |
| 60 | +Whether or not this fiscal position is active (enabled). |
| 61 | + |
| 62 | +### `company_id` |
| 63 | + |
| 64 | +```python |
| 65 | + company_id: Annotated[int, ModelRef("company_id", Company)] |
| 66 | +``` |
| 67 | + |
| 68 | +The ID for the company this fiscal position is associated with. |
| 69 | + |
| 70 | +### `company_name` |
| 71 | + |
| 72 | +```python |
| 73 | + company_name: Annotated[str, ModelRef("company_id", Company)] |
| 74 | +``` |
| 75 | + |
| 76 | +The name of the company this fiscal position is associated with. |
| 77 | + |
| 78 | +### `company` |
| 79 | + |
| 80 | +```python |
| 81 | + company: Annotated[Company, ModelRef("company_id", Company)] |
| 82 | +``` |
| 83 | + |
| 84 | +The company this fiscal position is associated with. |
| 85 | + |
| 86 | +This fetches the full record from Odoo once, |
| 87 | +and caches it for subsequent accesses. |
| 88 | + |
| 89 | +### `name` |
| 90 | + |
| 91 | +```python |
| 92 | +name: str |
| 93 | +``` |
| 94 | + |
| 95 | +The name of the fiscal position. |
| 96 | + |
| 97 | +Not guaranteed to be unique. |
| 98 | + |
| 99 | +### `tax_ids` |
| 100 | + |
| 101 | +```python |
| 102 | + tax_ids: Annotated[list[int], ModelRef("tax_ids", Tax)] |
| 103 | +``` |
| 104 | + |
| 105 | +The list of IDs for the taxes that will be applied |
| 106 | +to sale orders and invoices for partners using this |
| 107 | +fiscal position. |
| 108 | + |
| 109 | +### `taxes` |
| 110 | + |
| 111 | +```python |
| 112 | +taxes: Annotated[list[Tax], ModelRef("tax_ids", Tax)] |
| 113 | +``` |
| 114 | + |
| 115 | +The list of taxes that will be applied |
| 116 | +to sale orders and invoices for partners using this |
| 117 | +fiscal position. |
| 118 | + |
| 119 | +This fetches the full records from Odoo once, |
| 120 | +and caches them for subsequent accesses. |
0 commit comments