odoo-addon-l10n-br-fiscal 18.0.5.0.0.1__py3-none-any.whl → 18.0.7.1.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 +6 -2
- odoo/addons/l10n_br_fiscal/constants/fiscal.py +18 -0
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.cest.csv +1043 -983
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.cst.csv +58 -0
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.operation.indicator.csv +27 -0
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.classification.csv +163 -0
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.csv +31 -0
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.group.csv +3 -0
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +523 -43
- odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +523 -44
- odoo/addons/l10n_br_fiscal/models/__init__.py +2 -2
- odoo/addons/l10n_br_fiscal/models/data_abstract.py +9 -6
- odoo/addons/l10n_br_fiscal/models/document_line_mixin.py +993 -8
- odoo/addons/l10n_br_fiscal/models/document_mixin.py +236 -1
- odoo/addons/l10n_br_fiscal/models/operation_indicator.py +58 -0
- odoo/addons/l10n_br_fiscal/models/operation_line.py +28 -0
- odoo/addons/l10n_br_fiscal/models/product_template.py +4 -0
- odoo/addons/l10n_br_fiscal/models/res_company.py +17 -0
- odoo/addons/l10n_br_fiscal/models/res_partner.py +10 -0
- odoo/addons/l10n_br_fiscal/models/simplified_tax_range.py +8 -0
- odoo/addons/l10n_br_fiscal/models/tax_classification.py +81 -0
- odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +7 -1
- odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
- odoo/addons/l10n_br_fiscal/tests/__init__.py +1 -0
- odoo/addons/l10n_br_fiscal/tests/test_tax_classification.py +110 -0
- odoo/addons/l10n_br_fiscal/views/document_line_mixin_view.xml +106 -4
- odoo/addons/l10n_br_fiscal/views/document_line_view.xml +4 -0
- odoo/addons/l10n_br_fiscal/views/document_view.xml +14 -0
- odoo/addons/l10n_br_fiscal/views/icms_regulation_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +30 -0
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +16 -0
- odoo/addons/l10n_br_fiscal/views/nbs_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/ncm_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/operation_indicator_view.xml +75 -0
- odoo/addons/l10n_br_fiscal/views/operation_line_view.xml +4 -5
- odoo/addons/l10n_br_fiscal/views/operation_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/product_template_view.xml +5 -0
- odoo/addons/l10n_br_fiscal/views/res_company_view.xml +6 -0
- odoo/addons/l10n_br_fiscal/views/res_partner_view.xml +4 -0
- odoo/addons/l10n_br_fiscal/views/service_type_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/tax_classification.xml +108 -0
- odoo/addons/l10n_br_fiscal/views/tax_definition_view.xml +1 -5
- odoo/addons/l10n_br_fiscal/views/tax_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/wizards/__init__.py +1 -1
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard.py +234 -0
- odoo/addons/l10n_br_fiscal/wizards/{document_import_wizard_mixin.xml → document_import_wizard.xml} +26 -7
- {odoo_addon_l10n_br_fiscal-18.0.5.0.0.1.dist-info → odoo_addon_l10n_br_fiscal-18.0.7.1.0.dist-info}/METADATA +2 -2
- {odoo_addon_l10n_br_fiscal-18.0.5.0.0.1.dist-info → odoo_addon_l10n_br_fiscal-18.0.7.1.0.dist-info}/RECORD +51 -46
- odoo/addons/l10n_br_fiscal/models/document_line_mixin_methods.py +0 -818
- odoo/addons/l10n_br_fiscal/models/document_mixin_methods.py +0 -247
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +0 -129
- {odoo_addon_l10n_br_fiscal-18.0.5.0.0.1.dist-info → odoo_addon_l10n_br_fiscal-18.0.7.1.0.dist-info}/WHEEL +0 -0
- {odoo_addon_l10n_br_fiscal-18.0.5.0.0.1.dist-info → odoo_addon_l10n_br_fiscal-18.0.7.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<!-- Copyright 2025 Marcel Savegnago <https://escodoo.com.br>
|
|
3
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
|
+
<odoo>
|
|
5
|
+
<record id="tax_classification_search" model="ir.ui.view">
|
|
6
|
+
<field name="model">l10n_br_fiscal.tax.classification</field>
|
|
7
|
+
<field name="arch" type="xml">
|
|
8
|
+
<search string="Tax Classification">
|
|
9
|
+
<field name="code" />
|
|
10
|
+
<field name="name" />
|
|
11
|
+
<group expand="0" string="Group By...">
|
|
12
|
+
<filter
|
|
13
|
+
string="Rate Type"
|
|
14
|
+
name="rate_type"
|
|
15
|
+
domain="[]"
|
|
16
|
+
context="{'group_by': 'rate_type'}"
|
|
17
|
+
/>
|
|
18
|
+
<filter
|
|
19
|
+
string="Regular Taxation"
|
|
20
|
+
name="regular_taxation"
|
|
21
|
+
domain="[('regular_taxation', '=', True)]"
|
|
22
|
+
/>
|
|
23
|
+
<filter
|
|
24
|
+
string="Presumed Credit"
|
|
25
|
+
name="presumed_credit"
|
|
26
|
+
domain="[('presumed_credit', '=', True)]"
|
|
27
|
+
/>
|
|
28
|
+
</group>
|
|
29
|
+
</search>
|
|
30
|
+
</field>
|
|
31
|
+
</record>
|
|
32
|
+
|
|
33
|
+
<record id="tax_classification_tree" model="ir.ui.view">
|
|
34
|
+
<field name="model">l10n_br_fiscal.tax.classification</field>
|
|
35
|
+
<field name="arch" type="xml">
|
|
36
|
+
<list>
|
|
37
|
+
<field name="code" />
|
|
38
|
+
<field name="name" />
|
|
39
|
+
<field name="cst_code_prefix_like" column_invisible="True" />
|
|
40
|
+
<field name="tax_ibs_id" />
|
|
41
|
+
<field name="tax_cbs_id" />
|
|
42
|
+
<field name="regular_taxation" string="Regular Taxation" />
|
|
43
|
+
<field name="presumed_credit" string="Presumed Credit" />
|
|
44
|
+
<field name="credit_reversal" string="Credit Reversal" />
|
|
45
|
+
<field name="rate_type" string="Rate Type" />
|
|
46
|
+
<field
|
|
47
|
+
name="document_type_ids"
|
|
48
|
+
widget="many2many_tags"
|
|
49
|
+
string="Related DFes"
|
|
50
|
+
/>
|
|
51
|
+
</list>
|
|
52
|
+
</field>
|
|
53
|
+
</record>
|
|
54
|
+
|
|
55
|
+
<record id="tax_classification_form" model="ir.ui.view">
|
|
56
|
+
<field name="model">l10n_br_fiscal.tax.classification</field>
|
|
57
|
+
<field name="arch" type="xml">
|
|
58
|
+
<form string="Tax Classification">
|
|
59
|
+
<field name="id" invisible="1" />
|
|
60
|
+
<sheet>
|
|
61
|
+
<group>
|
|
62
|
+
<group>
|
|
63
|
+
<field name="code" />
|
|
64
|
+
<field name="name" />
|
|
65
|
+
<field name="cst_code_prefix_like" invisible="1" />
|
|
66
|
+
<field name="description" />
|
|
67
|
+
<field name="rate_type" />
|
|
68
|
+
</group>
|
|
69
|
+
</group>
|
|
70
|
+
<group string="Taxes">
|
|
71
|
+
<group>
|
|
72
|
+
<field name="tax_ibs_id" />
|
|
73
|
+
</group>
|
|
74
|
+
<group>
|
|
75
|
+
<field name="tax_cbs_id" />
|
|
76
|
+
</group>
|
|
77
|
+
</group>
|
|
78
|
+
<group string="Tax Indicators">
|
|
79
|
+
<group>
|
|
80
|
+
<field name="regular_taxation" />
|
|
81
|
+
</group>
|
|
82
|
+
<group>
|
|
83
|
+
<field name="presumed_credit" />
|
|
84
|
+
</group>
|
|
85
|
+
<group>
|
|
86
|
+
<field name="credit_reversal" />
|
|
87
|
+
</group>
|
|
88
|
+
</group>
|
|
89
|
+
<group string="Related Digital Fiscal Documents">
|
|
90
|
+
<field
|
|
91
|
+
name="document_type_ids"
|
|
92
|
+
widget="many2many_tags"
|
|
93
|
+
options="{'no_create': True, 'no_create_edit': True}"
|
|
94
|
+
/>
|
|
95
|
+
</group>
|
|
96
|
+
</sheet>
|
|
97
|
+
</form>
|
|
98
|
+
</field>
|
|
99
|
+
</record>
|
|
100
|
+
|
|
101
|
+
<record id="tax_classification_act_window" model="ir.actions.act_window">
|
|
102
|
+
<field name="name">Tax Classification</field>
|
|
103
|
+
<field name="res_model">l10n_br_fiscal.tax.classification</field>
|
|
104
|
+
<field name="view_mode">list,form</field>
|
|
105
|
+
<field name="domain">[]</field>
|
|
106
|
+
<field name="context">{}</field>
|
|
107
|
+
</record>
|
|
108
|
+
</odoo>
|
|
@@ -284,11 +284,7 @@
|
|
|
284
284
|
</page>
|
|
285
285
|
</notebook>
|
|
286
286
|
</sheet>
|
|
287
|
-
<
|
|
288
|
-
<field name="message_follower_ids" groups="base.group_user" />
|
|
289
|
-
<field name="activity_ids" />
|
|
290
|
-
<field name="message_ids" />
|
|
291
|
-
</div>
|
|
287
|
+
<chatter />
|
|
292
288
|
</form>
|
|
293
289
|
</field>
|
|
294
290
|
</record>
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
/>
|
|
96
96
|
<field
|
|
97
97
|
name="cst_in_id"
|
|
98
|
-
invisible="tax_domain not in ['icms', 'icmssn', 'ipi', 'pis', 'cofins']"
|
|
98
|
+
invisible="tax_domain not in ['icms', 'icmssn', 'ipi', 'pis', 'cofins', 'ibs', 'cbs']"
|
|
99
99
|
options="{'no_create': True, 'no_create_edit': True}"
|
|
100
100
|
/>
|
|
101
101
|
<field
|
|
102
102
|
name="cst_out_id"
|
|
103
|
-
invisible="tax_domain not in ['icms', 'icmssn', 'ipi', 'pis', 'cofins']"
|
|
103
|
+
invisible="tax_domain not in ['icms', 'icmssn', 'ipi', 'pis', 'cofins', 'ibs', 'cbs']"
|
|
104
104
|
options="{'no_create': True, 'no_create_edit': True}"
|
|
105
105
|
/>
|
|
106
106
|
</group>
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Copyright (C) 2023 Felipe Zago Rodrigues - Kmee
|
|
2
|
+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
+
|
|
4
|
+
import base64
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
from erpbrasil.base.fiscal.cnpj_cpf import validar_cnpj, validar_cpf
|
|
8
|
+
from erpbrasil.base.fiscal.edoc import detectar_chave_edoc
|
|
9
|
+
from erpbrasil.base.misc import punctuation_rm
|
|
10
|
+
|
|
11
|
+
from odoo import _, api, fields, models
|
|
12
|
+
from odoo.exceptions import UserError
|
|
13
|
+
|
|
14
|
+
from ..constants.fiscal import (
|
|
15
|
+
FISCAL_IN,
|
|
16
|
+
FISCAL_IN_OUT,
|
|
17
|
+
FISCAL_OUT,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
_logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
from xsdata.formats.dataclass.parsers import XmlParser
|
|
24
|
+
except ImportError:
|
|
25
|
+
_logger.warning("xsdata Python lib not installed!")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DocumentImportWizard(models.TransientModel):
|
|
29
|
+
_name = "l10n_br_fiscal.document.import.wizard"
|
|
30
|
+
_description = "Import Document Wizard"
|
|
31
|
+
_inherit = "l10n_br_fiscal.base.wizard.mixin"
|
|
32
|
+
|
|
33
|
+
company_id = fields.Many2one(
|
|
34
|
+
comodel_name="res.company",
|
|
35
|
+
string="Company",
|
|
36
|
+
default=lambda self: self.env.company.id,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
file = fields.Binary(string="File to Import")
|
|
40
|
+
|
|
41
|
+
fiscal_operation_id = fields.Many2one(
|
|
42
|
+
comodel_name="l10n_br_fiscal.operation",
|
|
43
|
+
string="Fiscal Operation",
|
|
44
|
+
domain="[('fiscal_operation_type', '=', fiscal_operation_type)]",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
document_type = fields.Char()
|
|
48
|
+
|
|
49
|
+
fiscal_operation_type = fields.Selection(
|
|
50
|
+
selection=FISCAL_IN_OUT,
|
|
51
|
+
compute="_compute_fiscal_operation_type",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
issuer_cnpj = fields.Char(string="Issuer CNPJ")
|
|
55
|
+
issuer_legal_name = fields.Char()
|
|
56
|
+
issuer_name = fields.Char(string="Fantasia")
|
|
57
|
+
issuer_partner_id = fields.Many2one(
|
|
58
|
+
comodel_name="res.partner",
|
|
59
|
+
)
|
|
60
|
+
issuer_type_in_out = fields.Selection(selection=FISCAL_IN_OUT, string="Issuer Type")
|
|
61
|
+
|
|
62
|
+
destination_cnpj = fields.Char(string="Destination CNPJ")
|
|
63
|
+
destination_name = fields.Char()
|
|
64
|
+
destination_partner_id = fields.Many2one(
|
|
65
|
+
comodel_name="res.partner",
|
|
66
|
+
)
|
|
67
|
+
destination_type_in_out = fields.Selection(
|
|
68
|
+
selection=FISCAL_IN_OUT, string="Destination Type"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
@api.depends("issuer_cnpj", "company_id.cnpj_cpf")
|
|
72
|
+
def _compute_fiscal_operation_type(self):
|
|
73
|
+
if self.issuer_cnpj == self.company_id.cnpj_cpf:
|
|
74
|
+
self.fiscal_operation_type = "out"
|
|
75
|
+
else:
|
|
76
|
+
self.fiscal_operation_type = "in"
|
|
77
|
+
|
|
78
|
+
def _search_partner(self, cnpj=None, name=None, legal_name=None):
|
|
79
|
+
"""
|
|
80
|
+
Search for a partner based on CNPJ, name, or legal name.
|
|
81
|
+
|
|
82
|
+
This method searches for a partner in the `res.partner` model
|
|
83
|
+
based on the provided CNPJ, name, or legal name.
|
|
84
|
+
If a CNPJ is provided, it validates whether it is a
|
|
85
|
+
company or an individual and constructs the search domain accordingly.
|
|
86
|
+
|
|
87
|
+
If a legal name or name is provided, it constructs the
|
|
88
|
+
search domain to match either the legal name or the name.
|
|
89
|
+
If neither CNPJ nor legal name/name is provided, it raises a UserError.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
cnpj (str, optional): The CNPJ or CPF of the partner.
|
|
93
|
+
name (str, optional): The name of the partner.
|
|
94
|
+
legal_name (str, optional): The legal name of the partner.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
recordset: A recordset of the found partner, limited to one result.
|
|
98
|
+
|
|
99
|
+
Raises:
|
|
100
|
+
UserError: If neither CNPJ nor legal name/name is provided.
|
|
101
|
+
"""
|
|
102
|
+
if cnpj:
|
|
103
|
+
if validar_cnpj(cnpj):
|
|
104
|
+
domain = [("is_company", "=", True)]
|
|
105
|
+
elif validar_cpf(cnpj):
|
|
106
|
+
domain = [("is_company", "=", False)]
|
|
107
|
+
domain.append(("cnpj_cpf_stripped", "=", punctuation_rm(cnpj)))
|
|
108
|
+
elif legal_name or name:
|
|
109
|
+
domain = [("is_company", "=", True)]
|
|
110
|
+
domain.append(
|
|
111
|
+
["|", ("legal_name", "ilike", legal_name), ("name", "ilike", name)]
|
|
112
|
+
)
|
|
113
|
+
else:
|
|
114
|
+
raise UserError(_("No CNPJ or Legal Name to search for a partner!"))
|
|
115
|
+
return self.env["res.partner"].search(domain, limit=1)
|
|
116
|
+
|
|
117
|
+
def _import_edoc(self):
|
|
118
|
+
self._find_existing_document()
|
|
119
|
+
if not self.document_id:
|
|
120
|
+
binding, self.document_id = self._create_edoc_from_file()
|
|
121
|
+
else:
|
|
122
|
+
binding = self._parse_file()
|
|
123
|
+
return binding, self.document_id
|
|
124
|
+
|
|
125
|
+
def action_import_and_open_document(self): # TODO used?
|
|
126
|
+
self._import_edoc()
|
|
127
|
+
return self.action_open_document()
|
|
128
|
+
|
|
129
|
+
def _destination_partner_from_binding(self, binding):
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
def _create_edoc_from_file(self):
|
|
133
|
+
pass # meant to be overriden
|
|
134
|
+
|
|
135
|
+
def _detect_document_type(self, code):
|
|
136
|
+
self.document_type_id = self.env["l10n_br_fiscal.document.type"].search(
|
|
137
|
+
[("code", "=", code)],
|
|
138
|
+
limit=1,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
def _find_existing_document(self):
|
|
142
|
+
self.document_id = self.env["l10n_br_fiscal.document"].search(
|
|
143
|
+
[("document_key", "=", self.document_key.replace(" ", ""))],
|
|
144
|
+
limit=1,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
@api.onchange("file")
|
|
148
|
+
def _onchange_file(self):
|
|
149
|
+
if self.file:
|
|
150
|
+
self._fill_wizard_from_binding()
|
|
151
|
+
|
|
152
|
+
def _fill_wizard_from_binding(self):
|
|
153
|
+
binding = self._parse_file()
|
|
154
|
+
self._detect_binding(binding)
|
|
155
|
+
self._extract_binding_data(binding)
|
|
156
|
+
self._find_existing_document()
|
|
157
|
+
self._destination_partner_from_binding(binding)
|
|
158
|
+
return binding
|
|
159
|
+
|
|
160
|
+
@api.model
|
|
161
|
+
def _detect_binding(self, binding):
|
|
162
|
+
"""
|
|
163
|
+
A pluggable method were each specialized fiscal document
|
|
164
|
+
importation wizard can register itself and return a tuple
|
|
165
|
+
with (the_fiscal_document_type_code, the_name_of_the_importation_wizard)
|
|
166
|
+
"""
|
|
167
|
+
raise UserError(
|
|
168
|
+
_("Importation not implemented for %s!")
|
|
169
|
+
% (
|
|
170
|
+
type(
|
|
171
|
+
binding,
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
def action_open_document(self):
|
|
177
|
+
return {
|
|
178
|
+
"name": _("Document Imported"),
|
|
179
|
+
"type": "ir.actions.act_window",
|
|
180
|
+
"target": "current",
|
|
181
|
+
"views": [[False, "form"]],
|
|
182
|
+
"res_id": self.document_id.id,
|
|
183
|
+
"res_model": "l10n_br_fiscal.document",
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
def _extract_binding_data(self, binding):
|
|
187
|
+
pass # meant to be overriden
|
|
188
|
+
|
|
189
|
+
def _extract_key_information(self, edoc_key):
|
|
190
|
+
"""TODO: Melhorar códifo da chave para não precisar
|
|
191
|
+
remover o tipo de chave do prefixo:
|
|
192
|
+
binding.NFe.infNFe.Id[3:]
|
|
193
|
+
"""
|
|
194
|
+
edoc = detectar_chave_edoc(edoc_key)
|
|
195
|
+
self.document_key = " ".join(edoc.partes())
|
|
196
|
+
self.document_number = edoc.numero_documento.strip("0")
|
|
197
|
+
self.document_serie = edoc.numero_serie.strip("0")
|
|
198
|
+
self.issuer_cnpj = edoc.cnpj_cpf_emitente
|
|
199
|
+
self.issuer_partner_id = self._search_partner(edoc.cnpj_cpf_emitente)
|
|
200
|
+
if edoc.forma_emissao == "1":
|
|
201
|
+
self.issuer_type_in_out = FISCAL_OUT
|
|
202
|
+
self.destination_type_in_out = FISCAL_IN
|
|
203
|
+
else:
|
|
204
|
+
self.issuer_type_in_out = FISCAL_IN
|
|
205
|
+
self.destination_type_in_out = FISCAL_OUT
|
|
206
|
+
|
|
207
|
+
def _find_document_type(self, code):
|
|
208
|
+
return self.env["l10n_br_fiscal.document.type"].search(
|
|
209
|
+
[("code", "=", code)],
|
|
210
|
+
limit=1,
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
def _find_fiscal_operation(self, cfop, nat_op, fiscal_operation_type):
|
|
214
|
+
"""try to find a matching fiscal operation via an operation line"""
|
|
215
|
+
operation_lines = self.env["l10n_br_fiscal.operation.line"].search(
|
|
216
|
+
[
|
|
217
|
+
("state", "=", "approved"),
|
|
218
|
+
("fiscal_type", "=", fiscal_operation_type),
|
|
219
|
+
("cfop_external_id", "=", cfop),
|
|
220
|
+
],
|
|
221
|
+
)
|
|
222
|
+
for line in operation_lines:
|
|
223
|
+
if line.fiscal_operation_id.name == nat_op:
|
|
224
|
+
return line.fiscal_operation_id
|
|
225
|
+
if operation_lines:
|
|
226
|
+
return operation_lines[0].fiscal_operation_id
|
|
227
|
+
|
|
228
|
+
def _parse_file(self):
|
|
229
|
+
return self._parse_file_data(self.file)
|
|
230
|
+
|
|
231
|
+
@api.model
|
|
232
|
+
def _parse_file_data(self, file_data):
|
|
233
|
+
# NOTE: no try and a stacktrace does help for debug/support
|
|
234
|
+
return XmlParser().from_bytes(base64.b64decode(file_data))
|
odoo/addons/l10n_br_fiscal/wizards/{document_import_wizard_mixin.xml → document_import_wizard.xml}
RENAMED
|
@@ -2,25 +2,44 @@
|
|
|
2
2
|
<!-- Copyright 2023 KMEE
|
|
3
3
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
<record id="
|
|
6
|
-
<field name="name">
|
|
7
|
-
<field name="model">l10n_br_fiscal.document.import.wizard
|
|
5
|
+
<record id="document_import_wizard_form" model="ir.ui.view">
|
|
6
|
+
<field name="name">document.import.wizard.form</field>
|
|
7
|
+
<field name="model">l10n_br_fiscal.document.import.wizard</field>
|
|
8
8
|
<field name="arch" type="xml">
|
|
9
9
|
<form string="Import Document">
|
|
10
10
|
<group>
|
|
11
11
|
<field name="file" required="1" />
|
|
12
|
+
<field name="document_key" invisible="file == False" />
|
|
12
13
|
</group>
|
|
13
14
|
<separator string="Preview Data" invisible="not file" />
|
|
14
15
|
<group id="document_info" invisible="not file">
|
|
15
16
|
<group>
|
|
16
17
|
<field name="fiscal_operation_id" required="1" />
|
|
17
18
|
<field name="fiscal_operation_type" invisible="1" />
|
|
18
|
-
<field name="
|
|
19
|
-
<field name="
|
|
20
|
-
<field name="document_serie" readonly="1" />
|
|
19
|
+
<field name="document_type_id" readonly="1" force_save="1" />
|
|
20
|
+
<field name="document_type" readonly="1" force_save="1" />
|
|
21
21
|
</group>
|
|
22
22
|
<group>
|
|
23
|
-
<field name="
|
|
23
|
+
<field name="document_number" readonly="1" force_save="1" />
|
|
24
|
+
<field name="document_serie" readonly="1" force_save="1" />
|
|
25
|
+
</group>
|
|
26
|
+
<group string="Emitente">
|
|
27
|
+
<field name="issuer_cnpj" readonly="1" force_save="1" />
|
|
28
|
+
<field name="issuer_partner_id" readonly="1" force_save="1" />
|
|
29
|
+
<field name="issuer_type_in_out" readonly="1" force_save="1" />
|
|
30
|
+
</group>
|
|
31
|
+
<group string="Destinatário">
|
|
32
|
+
<field name="destination_cnpj" readonly="1" force_save="1" />
|
|
33
|
+
<field
|
|
34
|
+
name="destination_partner_id"
|
|
35
|
+
readonly="1"
|
|
36
|
+
force_save="1"
|
|
37
|
+
/>
|
|
38
|
+
<field
|
|
39
|
+
name="destination_type_in_out"
|
|
40
|
+
readonly="1"
|
|
41
|
+
force_save="1"
|
|
42
|
+
/>
|
|
24
43
|
</group>
|
|
25
44
|
</group>
|
|
26
45
|
<footer>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-l10n_br_fiscal
|
|
3
|
-
Version: 18.0.
|
|
3
|
+
Version: 18.0.7.1.0
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: erpbrasil.base
|
|
6
6
|
Requires-Dist: odoo-addon-l10n_br_base==18.0.*
|
|
@@ -31,7 +31,7 @@ Módulo fiscal brasileiro
|
|
|
31
31
|
!! This file is generated by oca-gen-addon-readme !!
|
|
32
32
|
!! changes will be overwritten. !!
|
|
33
33
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
34
|
-
!! source digest: sha256:
|
|
34
|
+
!! source digest: sha256:5cd8cb0b01f3ea46d8329418b2478d777a70350607e16eee38900f6a08e7e3f2
|
|
35
35
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
36
36
|
|
|
37
37
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|