odoo-addon-l10n-br-fiscal 16.0.2.21.3__py3-none-any.whl → 16.0.3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-l10n-br-fiscal might be problematic. Click here for more details.
- odoo/addons/l10n_br_fiscal/README.rst +1 -1
- odoo/addons/l10n_br_fiscal/__manifest__.py +1 -1
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +1 -142
- odoo/addons/l10n_br_fiscal/models/__init__.py +0 -2
- odoo/addons/l10n_br_fiscal/models/document.py +200 -2
- odoo/addons/l10n_br_fiscal/models/document_mixin.py +477 -6
- odoo/addons/l10n_br_fiscal/models/document_mixin_methods.py +45 -1
- odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
- {odoo_addon_l10n_br_fiscal-16.0.2.21.3.dist-info → odoo_addon_l10n_br_fiscal-16.0.3.0.0.dist-info}/METADATA +2 -2
- {odoo_addon_l10n_br_fiscal-16.0.2.21.3.dist-info → odoo_addon_l10n_br_fiscal-16.0.3.0.0.dist-info}/RECORD +12 -14
- odoo/addons/l10n_br_fiscal/models/document_mixin_fields.py +0 -479
- odoo/addons/l10n_br_fiscal/models/document_move_mixin.py +0 -259
- {odoo_addon_l10n_br_fiscal-16.0.2.21.3.dist-info → odoo_addon_l10n_br_fiscal-16.0.3.0.0.dist-info}/WHEEL +0 -0
- {odoo_addon_l10n_br_fiscal-16.0.2.21.3.dist-info → odoo_addon_l10n_br_fiscal-16.0.3.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
# Copyright (C) 2021 Renato Lima - Akretion <renato.lima@akretion.com.br>
|
|
2
|
-
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
-
|
|
4
|
-
from odoo import api, fields, models
|
|
5
|
-
|
|
6
|
-
from ..constants.fiscal import DOCUMENT_ISSUER_COMPANY
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class DocumentMoveMixin(models.AbstractModel):
|
|
10
|
-
_name = "l10n_br_fiscal.document.move.mixin"
|
|
11
|
-
_inherit = [
|
|
12
|
-
"l10n_br_fiscal.document.mixin.methods",
|
|
13
|
-
]
|
|
14
|
-
_description = "Move Document Fiscal Mixin"
|
|
15
|
-
|
|
16
|
-
partner_id = fields.Many2one(
|
|
17
|
-
comodel_name="res.partner",
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
partner_legal_name = fields.Char(
|
|
21
|
-
string="Legal Name",
|
|
22
|
-
related="partner_id.legal_name",
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
partner_name = fields.Char(
|
|
26
|
-
string="Partner Name",
|
|
27
|
-
related="partner_id.name",
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
partner_cnpj_cpf = fields.Char(
|
|
31
|
-
string="CNPJ",
|
|
32
|
-
related="partner_id.cnpj_cpf",
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
partner_inscr_est = fields.Char(
|
|
36
|
-
string="State Tax Number",
|
|
37
|
-
related="partner_id.inscr_est",
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
partner_ind_ie_dest = fields.Selection(
|
|
41
|
-
string="Contribuinte do ICMS",
|
|
42
|
-
related="partner_id.ind_ie_dest",
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
partner_inscr_mun = fields.Char(
|
|
46
|
-
string="Municipal Tax Number",
|
|
47
|
-
related="partner_id.inscr_mun",
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
partner_suframa = fields.Char(
|
|
51
|
-
string="Suframa",
|
|
52
|
-
related="partner_id.suframa",
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
partner_cnae_main_id = fields.Many2one(
|
|
56
|
-
comodel_name="l10n_br_fiscal.cnae",
|
|
57
|
-
string="Main CNAE",
|
|
58
|
-
related="partner_id.cnae_main_id",
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
partner_tax_framework = fields.Selection(
|
|
62
|
-
string="Tax Framework",
|
|
63
|
-
related="partner_id.tax_framework",
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
partner_street = fields.Char(
|
|
67
|
-
string="Partner Street",
|
|
68
|
-
related="partner_id.street",
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
partner_number = fields.Char(
|
|
72
|
-
string="Partner Number",
|
|
73
|
-
related="partner_id.street_number",
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
partner_street2 = fields.Char(
|
|
77
|
-
string="Partner Street2",
|
|
78
|
-
related="partner_id.street2",
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
partner_district = fields.Char(
|
|
82
|
-
string="Partner District",
|
|
83
|
-
related="partner_id.district",
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
partner_country_id = fields.Many2one(
|
|
87
|
-
comodel_name="res.country",
|
|
88
|
-
string="Partner Country",
|
|
89
|
-
related="partner_id.country_id",
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
partner_state_id = fields.Many2one(
|
|
93
|
-
comodel_name="res.country.state",
|
|
94
|
-
string="Partner State",
|
|
95
|
-
related="partner_id.state_id",
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
partner_city_id = fields.Many2one(
|
|
99
|
-
comodel_name="res.city",
|
|
100
|
-
string="Partner City",
|
|
101
|
-
related="partner_id.city_id",
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
partner_zip = fields.Char(
|
|
105
|
-
string="Partner Zip",
|
|
106
|
-
related="partner_id.zip",
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
partner_phone = fields.Char(
|
|
110
|
-
string="Partner Phone",
|
|
111
|
-
related="partner_id.phone",
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
partner_is_company = fields.Boolean(
|
|
115
|
-
string="Partner Is Company?",
|
|
116
|
-
related="partner_id.is_company",
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
company_id = fields.Many2one(
|
|
120
|
-
comodel_name="res.company",
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
processador_edoc = fields.Selection(
|
|
124
|
-
related="company_id.processador_edoc",
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
company_legal_name = fields.Char(
|
|
128
|
-
string="Company Legal Name",
|
|
129
|
-
related="company_id.legal_name",
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
company_name = fields.Char(
|
|
133
|
-
string="Company Name",
|
|
134
|
-
size=128,
|
|
135
|
-
related="company_id.name",
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
company_cnpj_cpf = fields.Char(
|
|
139
|
-
string="Company CNPJ",
|
|
140
|
-
related="company_id.cnpj_cpf",
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
company_inscr_est = fields.Char(
|
|
144
|
-
string="Company State Tax Number",
|
|
145
|
-
related="company_id.inscr_est",
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
company_inscr_est_st = fields.Char(
|
|
149
|
-
string="Company ST State Tax Number",
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
company_inscr_mun = fields.Char(
|
|
153
|
-
string="Company Municipal Tax Number",
|
|
154
|
-
related="company_id.inscr_mun",
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
company_suframa = fields.Char(
|
|
158
|
-
string="Company Suframa",
|
|
159
|
-
related="company_id.suframa",
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
company_cnae_main_id = fields.Many2one(
|
|
163
|
-
comodel_name="l10n_br_fiscal.cnae",
|
|
164
|
-
string="Company Main CNAE",
|
|
165
|
-
related="company_id.cnae_main_id",
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
company_tax_framework = fields.Selection(
|
|
169
|
-
string="Company Tax Framework",
|
|
170
|
-
related="company_id.tax_framework",
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
company_street = fields.Char(
|
|
174
|
-
string="Company Street",
|
|
175
|
-
related="company_id.street",
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
company_number = fields.Char(
|
|
179
|
-
string="Company Number",
|
|
180
|
-
related="company_id.street_number",
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
company_street2 = fields.Char(
|
|
184
|
-
string="Company Street2",
|
|
185
|
-
related="company_id.street2",
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
company_district = fields.Char(
|
|
189
|
-
string="Company District",
|
|
190
|
-
related="company_id.district",
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
company_country_id = fields.Many2one(
|
|
194
|
-
comodel_name="res.country",
|
|
195
|
-
string="Company Country",
|
|
196
|
-
related="company_id.country_id",
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
company_state_id = fields.Many2one(
|
|
200
|
-
comodel_name="res.country.state",
|
|
201
|
-
string="Company State",
|
|
202
|
-
related="company_id.state_id",
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
company_city_id = fields.Many2one(
|
|
206
|
-
comodel_name="res.city",
|
|
207
|
-
string="Company City",
|
|
208
|
-
related="company_id.city_id",
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
company_zip = fields.Char(
|
|
212
|
-
string="Company ZIP",
|
|
213
|
-
related="company_id.zip",
|
|
214
|
-
)
|
|
215
|
-
|
|
216
|
-
company_phone = fields.Char(
|
|
217
|
-
string="Company Phone",
|
|
218
|
-
related="company_id.phone",
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
@api.onchange("document_type_id")
|
|
222
|
-
def _onchange_document_type_id(self):
|
|
223
|
-
if self.document_type_id and self.issuer == DOCUMENT_ISSUER_COMPANY:
|
|
224
|
-
self.document_serie_id = self.document_type_id.get_document_serie(
|
|
225
|
-
self.company_id, self.fiscal_operation_id
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
@api.onchange("document_serie_id")
|
|
229
|
-
def _onchange_document_serie_id(self):
|
|
230
|
-
if self.document_serie_id and self.issuer == DOCUMENT_ISSUER_COMPANY:
|
|
231
|
-
self.document_serie = self.document_serie_id.code
|
|
232
|
-
|
|
233
|
-
@api.onchange("fiscal_operation_id")
|
|
234
|
-
def _onchange_fiscal_operation_id(self):
|
|
235
|
-
if self.fiscal_operation_id:
|
|
236
|
-
self.fiscal_operation_type = self.fiscal_operation_id.fiscal_operation_type
|
|
237
|
-
self.edoc_purpose = self.fiscal_operation_id.edoc_purpose
|
|
238
|
-
|
|
239
|
-
if self.issuer == DOCUMENT_ISSUER_COMPANY and not self.document_type_id:
|
|
240
|
-
self.document_type_id = self.company_id.document_type_id
|
|
241
|
-
|
|
242
|
-
subsequent_documents = [(6, 0, {})]
|
|
243
|
-
for subsequent_id in self.fiscal_operation_id.mapped(
|
|
244
|
-
"operation_subsequent_ids"
|
|
245
|
-
):
|
|
246
|
-
subsequent_documents.append(
|
|
247
|
-
(
|
|
248
|
-
0,
|
|
249
|
-
0,
|
|
250
|
-
{
|
|
251
|
-
"source_document_id": self.id,
|
|
252
|
-
"subsequent_operation_id": subsequent_id.id,
|
|
253
|
-
"fiscal_operation_id": (
|
|
254
|
-
subsequent_id.subsequent_operation_id.id
|
|
255
|
-
),
|
|
256
|
-
},
|
|
257
|
-
)
|
|
258
|
-
)
|
|
259
|
-
self.document_subsequent_ids = subsequent_documents
|
|
File without changes
|
|
File without changes
|