-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount_move_line.py
More file actions
160 lines (121 loc) · 5.1 KB
/
account_move_line.py
File metadata and controls
160 lines (121 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Copyright (C) 2024 Catalyst Cloud Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
from typing import Annotated, Literal
from ..base.record.base import RecordBase
from ..base.record.types import ModelRef
from ..base.record_manager.base import RecordManagerBase
class AccountMoveLine(RecordBase["AccountMoveLineManager"]):
currency_id: Annotated[int, ModelRef("currency_id", Currency)]
"""The ID for the currency used in this
account move (invoice) line.
"""
currency_name: Annotated[int, ModelRef("currency_id", Currency)]
"""The name of the currency used in this
account move (invoice) line.
"""
currency: Annotated[Currency, ModelRef("currency_id", Currency)]
"""The currency used in this
account move (invoice) line.
This fetches the full record from Odoo once,
and caches it for subsequent accesses.
"""
line_tax_amount: float
"""Amount charged in tax on the account move (invoice) line."""
move_id: Annotated[int, ModelRef("move_id", AccountMove)]
"""The ID for the account move (invoice) this line is part of."""
move_name: Annotated[str, ModelRef("move_id", AccountMove)]
"""The name of the account move (invoice) this line is part of."""
move: Annotated[AccountMove, ModelRef("move_id", AccountMove)]
"""The account move (invoice) this line is part of.
This fetches the full record from Odoo once,
and caches it for subsequent accesses.
"""
name: str
"""Name of the product charged on the account move (invoice) line."""
os_project_id: Annotated[int | None, ModelRef("os_project", Project)]
"""The ID for the OpenStack project this account move (invoice) line
was generated for.
"""
os_project_name: Annotated[str | None, ModelRef("os_project", Project)]
"""The name of the OpenStack project this account move (invoice) line
was generated for.
"""
os_project: Annotated[Project | None, ModelRef("os_project", Project)]
"""The OpenStack project this account move (invoice) line
was generated for.
This fetches the full record from Odoo once,
and caches it for subsequent accesses.
"""
os_region: str | Literal[False]
"""The OpenStack region the account move (invoice) line
was created from.
"""
os_resource_id: str | Literal[False]
"""The OpenStack resource ID for the resource that generated
this account move (invoice) line.
"""
os_resource_name: str | Literal[False]
"""The name of the OpenStack resource tier or flavour,
as used by services such as Distil for rating purposes.
For example, if this is the account move (invoice) line
for a compute instance, this would be set to the instance's flavour name.
"""
os_resource_type: str | Literal[False]
"""A human-readable description of the type of resource captured
by this account move (invoice) line.
"""
price_subtotal: float
"""Amount charged for the product (untaxed) on the
account move (invoice) line.
"""
price_unit: float
"""Unit price for the product used on the account move (invoice) line."""
product_id: Annotated[int, ModelRef("product_id", Product)]
"""The ID for the product charged on the
account move (invoice) line.
"""
product_name: Annotated[str, ModelRef("product_id", Product)]
"""The name of the product charged on the
account move (invoice) line.
"""
product: Annotated[Product, ModelRef("product_id", Product)]
"""The product charged on the
account move (invoice) line.
This fetches the full record from Odoo once,
and caches it for subsequent accesses.
"""
quantity: float
"""Quantity of product charged on the account move (invoice) line."""
tax_ids: Annotated[list[int], ModelRef("tax_ids", Tax)]
"""The list of IDs for the taxes that are applied
on this account move (invoice) line.
*Added in version 0.2.3.*
"""
taxes: Annotated[list[Tax], ModelRef("tax_ids", Tax)]
"""The list of taxes that are applied on this account move (invoice) line.
This fetches the full records from Odoo once,
and caches them for subsequent accesses.
*Added in version 0.2.3.*
"""
class AccountMoveLineManager(RecordManagerBase[AccountMoveLine]):
env_name = "account.move.line"
record_class = AccountMoveLine
# NOTE(callumdickinson): Import here to make sure circular imports work.
from .account_move import AccountMove # noqa: E402
from .currency import Currency # noqa: E402
from .product import Product # noqa: E402
from .project import Project # noqa: E402
from .tax import Tax # noqa: E402