odoo-addon-l10n-br-fiscal 16.0.1.18.2.1__py3-none-any.whl → 16.0.2.0.0.2__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.

Files changed (42) hide show
  1. odoo/addons/l10n_br_fiscal/README.rst +1 -1
  2. odoo/addons/l10n_br_fiscal/__manifest__.py +2 -12
  3. odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +72 -820
  4. odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +72 -0
  5. odoo/addons/l10n_br_fiscal/migrations/16.0.2.0.0/pre-migration.py +25 -0
  6. odoo/addons/l10n_br_fiscal/models/__init__.py +0 -3
  7. odoo/addons/l10n_br_fiscal/models/document.py +62 -20
  8. odoo/addons/l10n_br_fiscal/models/invalidate_number.py +0 -44
  9. odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +0 -5
  10. odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
  11. odoo/addons/l10n_br_fiscal/tests/__init__.py +0 -1
  12. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +0 -48
  13. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_nfse.py +0 -2
  14. odoo/addons/l10n_br_fiscal/tests/test_subsequent_operation.py +2 -1
  15. odoo/addons/l10n_br_fiscal/tests/test_tax_benefit.py +0 -21
  16. odoo/addons/l10n_br_fiscal/views/document_view.xml +3 -69
  17. odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +2 -7
  18. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +0 -34
  19. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +0 -19
  20. odoo/addons/l10n_br_fiscal/wizards/__init__.py +0 -6
  21. odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py +0 -5
  22. odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.py +2 -0
  23. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/METADATA +3 -3
  24. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/RECORD +26 -41
  25. odoo/addons/l10n_br_fiscal/models/document_eletronic.py +0 -233
  26. odoo/addons/l10n_br_fiscal/models/document_event.py +0 -392
  27. odoo/addons/l10n_br_fiscal/models/document_workflow.py +0 -402
  28. odoo/addons/l10n_br_fiscal/tests/test_workflow.py +0 -118
  29. odoo/addons/l10n_br_fiscal/views/document_event_report.xml +0 -15
  30. odoo/addons/l10n_br_fiscal/views/document_event_template.xml +0 -114
  31. odoo/addons/l10n_br_fiscal/views/document_event_view.xml +0 -68
  32. odoo/addons/l10n_br_fiscal/wizards/document_cancel_wizard.py +0 -20
  33. odoo/addons/l10n_br_fiscal/wizards/document_cancel_wizard.xml +0 -30
  34. odoo/addons/l10n_br_fiscal/wizards/document_correction_wizard.py +0 -17
  35. odoo/addons/l10n_br_fiscal/wizards/document_correction_wizard.xml +0 -30
  36. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +0 -132
  37. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.xml +0 -44
  38. odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.xml +0 -58
  39. odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.py +0 -29
  40. odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.xml +0 -30
  41. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/WHEEL +0 -0
  42. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/top_level.txt +0 -0
@@ -1,68 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <odoo>
3
-
4
- <record id="event_search" model="ir.ui.view">
5
- <field name="name">l10n_br_fiscal.event.search</field>
6
- <field name="model">l10n_br_fiscal.event</field>
7
- <field name="arch" type="xml">
8
- <search string="Fiscal Document Event">
9
- <field name="origin" />
10
- </search>
11
- </field>
12
- </record>
13
-
14
- <record id="event_tree" model="ir.ui.view">
15
- <field name="name">l10n_br_fiscal.event.tree</field>
16
- <field name="model">l10n_br_fiscal.event</field>
17
- <field name="arch" type="xml">
18
- <tree edit="false" create="false">
19
- <field name="type" />
20
- <field name="company_id" />
21
- <field name="response" />
22
- <field name="origin" />
23
- <field name="write_date" />
24
- <field name="protocol_date" />
25
- <field name="status_code" />
26
- <field name="message" />
27
- <field name="state" />
28
- </tree>
29
- </field>
30
- </record>
31
-
32
- <record id="event_form" model="ir.ui.view">
33
- <field name="name">l10n_br_fiscal.event.form</field>
34
- <field name="model">l10n_br_fiscal.event</field>
35
- <field name="arch" type="xml">
36
- <form string="Eventos Eletronicos" edit="false" create="false">
37
- <header>
38
- <field name="state" widget="statusbar" />
39
- </header>
40
- <sheet>
41
- <group>
42
- <field name="type" />
43
- <field name="company_id" />
44
- <field name="document_id" />
45
- <field name="document_type_id" />
46
- <field name="invalidate_number_id" />
47
- <field name="sequence" />
48
- <field name="justification" />
49
- <field name="partner_id" />
50
- <field name="file_request_id" />
51
- <field name="file_response_id" />
52
- <field name="protocol_number" />
53
- <field name="lot_receipt_number" />
54
- <field name="response" />
55
- <field name="origin" />
56
- <field name="write_date" />
57
- <field name="file_path" />
58
- <field name="protocol_date" />
59
- <field name="status_code" />
60
- <field name="message" />
61
- <field name="state" />
62
- </group>
63
- </sheet>
64
- </form>
65
- </field>
66
- </record>
67
-
68
- </odoo>
@@ -1,20 +0,0 @@
1
- # Copyright 2019 KMEE
2
- # Copyright (C) 2020 Renato Lima - Akretion <renato.lima@akretion.com.br>
3
- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4
-
5
- from odoo import models
6
-
7
-
8
- class DocumentCancelWizard(models.TransientModel):
9
- _name = "l10n_br_fiscal.document.cancel.wizard"
10
- _description = "Fiscal Document Cancel Wizard"
11
- _inherit = "l10n_br_fiscal.base.wizard.mixin"
12
-
13
- def do_cancel(self):
14
- self.document_id._document_cancel(self.justification)
15
-
16
- def doit(self):
17
- for wizard in self:
18
- if wizard.document_id:
19
- wizard.do_cancel()
20
- self._close()
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <!-- Copyright 2019 KMEE
3
- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4
- <odoo>
5
-
6
- <record id="document_cancel_wizard_form" model="ir.ui.view">
7
- <field name="name">l10n_br_fiscal.document.cancel.wizard</field>
8
- <field name="model">l10n_br_fiscal.document.cancel.wizard</field>
9
- <field name="arch" type="xml">
10
- <form string="Cancelamento de documento fiscal">
11
- <group>
12
- <field name="justification" />
13
- </group>
14
- <footer>
15
- <button name="doit" string="OK" class="btn-primary" type="object" />
16
- <button string="Cancel" class="btn-default" special="cancel" />
17
- </footer>
18
- </form>
19
- </field>
20
- </record>
21
-
22
- <record id="document_cancel_wizard_action" model="ir.actions.act_window">
23
- <field name="name">Cancelamento de documento fiscal</field>
24
- <field name="res_model">l10n_br_fiscal.document.cancel.wizard</field>
25
- <field name="view_mode">form</field>
26
- <field name="context">{}</field>
27
- <field name="target">new</field>
28
- </record>
29
-
30
- </odoo>
@@ -1,17 +0,0 @@
1
- # Copyright 2019 KMEE
2
- # Copyright (C) 2020 Renato Lima - Akretion <renato.lima@akretion.com.br>
3
- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4
-
5
- from odoo import models
6
-
7
-
8
- class DocumentCorrectionWizard(models.TransientModel):
9
- _name = "l10n_br_fiscal.document.correction.wizard"
10
- _description = "Fiscal Document Correction Wizard"
11
- _inherit = "l10n_br_fiscal.base.wizard.mixin"
12
-
13
- def doit(self):
14
- for wizard in self:
15
- if wizard.document_id:
16
- wizard.document_id._document_correction(wizard.justification)
17
- self._close()
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <!-- Copyright 2019 KMEE
3
- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4
- <odoo>
5
-
6
- <record id="document_correction_wizard_form" model="ir.ui.view">
7
- <field name="name">l10n_br_fiscal.document.correction.wizard.form</field>
8
- <field name="model">l10n_br_fiscal.document.correction.wizard</field>
9
- <field name="arch" type="xml">
10
- <form string="Carta de Correção">
11
- <group>
12
- <field name="justification" />
13
- </group>
14
- <footer>
15
- <button name="doit" string="OK" class="btn-primary" type="object" />
16
- <button string="Cancel" class="btn-default" special="cancel" />
17
- </footer>
18
- </form>
19
- </field>
20
- </record>
21
-
22
- <record id="document_correction_wizard_action" model="ir.actions.act_window">
23
- <field name="name">Carta de Correção</field>
24
- <field name="res_model">l10n_br_fiscal.document.correction.wizard</field>
25
- <field name="view_mode">form</field>
26
- <field name="context">{}</field>
27
- <field name="target">new</field>
28
- </record>
29
-
30
- </odoo>
@@ -1,132 +0,0 @@
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 odoo import _, api, fields, models
8
- from odoo.exceptions import UserError
9
-
10
- from ..constants.fiscal import FISCAL_IN_OUT_ALL
11
-
12
- _logger = logging.getLogger(__name__)
13
-
14
- try:
15
- from xsdata.formats.dataclass.parsers import XmlParser
16
- except ImportError:
17
- _logger.error(_("xsdata Python lib not installed!"))
18
-
19
-
20
- class DocumentImportWizardMixin(models.TransientModel):
21
- _name = "l10n_br_fiscal.document.import.wizard.mixin"
22
- _description = "Wizard Import Document Mixin"
23
- _inherit = "l10n_br_fiscal.base.wizard.mixin"
24
-
25
- company_id = fields.Many2one(
26
- comodel_name="res.company",
27
- string="Company",
28
- default=lambda self: self.env.company.id,
29
- )
30
-
31
- file = fields.Binary(string="File to Import")
32
-
33
- fiscal_operation_id = fields.Many2one(
34
- comodel_name="l10n_br_fiscal.operation",
35
- string="Fiscal Operation",
36
- domain="[('fiscal_operation_type', '=', fiscal_operation_type)]",
37
- )
38
-
39
- document_type = fields.Char()
40
-
41
- fiscal_operation_type = fields.Selection(selection=FISCAL_IN_OUT_ALL)
42
-
43
- def _import_edoc(self):
44
- self._find_existing_document()
45
- if not self.document_id:
46
- binding, self.document_id = self._create_edoc_from_file()
47
- else:
48
- binding = self._parse_file()
49
- return binding, self.document_id
50
-
51
- def action_import_and_open_document(self):
52
- self._import_edoc()
53
- return self.action_open_document()
54
-
55
- def _create_edoc_from_file(self):
56
- pass # meant to be overriden
57
-
58
- @api.onchange("file")
59
- def _onchange_file(self):
60
- if self.file:
61
- self._fill_wizard_from_binding()
62
-
63
- def _fill_wizard_from_binding(self):
64
- pass # meant to be overriden
65
-
66
- def action_open_document(self):
67
- return {
68
- "name": _("Document Imported"),
69
- "type": "ir.actions.act_window",
70
- "target": "current",
71
- "views": [[False, "form"]],
72
- "res_id": self.document_id.id,
73
- "res_model": "l10n_br_fiscal.document",
74
- }
75
-
76
- def _document_key_from_binding(self, binding):
77
- pass # meant to be overriden
78
-
79
- def _find_existing_document(self):
80
- document_key = self._document_key_from_binding(self._parse_file())
81
- self.document_id = self.env["l10n_br_fiscal.document"].search(
82
- [("document_key", "=", document_key.chave)],
83
- limit=1,
84
- )
85
-
86
- def _find_document_type(self, code):
87
- return self.env["l10n_br_fiscal.document.type"].search(
88
- [("code", "=", code)],
89
- limit=1,
90
- )
91
-
92
- def _find_fiscal_operation(self, cfop, nat_op, fiscal_operation_type):
93
- """try to find a matching fiscal operation via an operation line"""
94
- operation_lines = self.env["l10n_br_fiscal.operation.line"].search(
95
- [
96
- ("state", "=", "approved"),
97
- ("fiscal_type", "=", fiscal_operation_type),
98
- ("cfop_external_id", "=", cfop),
99
- ],
100
- )
101
- for line in operation_lines:
102
- if line.fiscal_operation_id.name == nat_op:
103
- return line.fiscal_operation_id
104
- if operation_lines:
105
- return operation_lines[0].fiscal_operation_id
106
-
107
- def _parse_file(self):
108
- return self._parse_file_data(self.file)
109
-
110
- @api.model
111
- def _parse_file_data(self, file_data):
112
- try:
113
- binding = XmlParser().from_bytes(base64.b64decode(file_data))
114
- except Exception as e:
115
- raise UserError(_("Invalid file!")) from e
116
- return binding
117
-
118
- @api.model
119
- def _detect_binding(self, binding):
120
- """
121
- A pluggable method were each specialized fiscal document
122
- importation wizard can register itself and return a tuple
123
- with (the_fiscal_document_type_code, the_name_of_the_importation_wizard)
124
- """
125
- raise UserError(
126
- _("Importation not implemented for %s!")
127
- % (
128
- type(
129
- binding,
130
- )
131
- )
132
- )
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <!-- Copyright 2023 KMEE
3
- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4
- <odoo>
5
-
6
- <record id="l10n_br_fiscal_document_import_wizard_mixin_form" model="ir.ui.view">
7
- <field name="name">l10n_br_fiscal.document.import.wizard.mixin.form</field>
8
- <field name="model">l10n_br_fiscal.document.import.wizard.mixin</field>
9
- <field name="arch" type="xml">
10
- <form string="Import Document">
11
- <group>
12
- <field name="file" required="1" />
13
- </group>
14
- <separator
15
- string="Preview Data"
16
- attrs="{'invisible': [('file', '=', False)]}"
17
- />
18
- <group id="document_info" attrs="{'invisible': [('file', '=', False)]}">
19
- <group>
20
- <field name="fiscal_operation_id" required="1" />
21
- <field name="fiscal_operation_type" invisible="1" />
22
- <field name="document_key" readonly="1" />
23
- <field name="document_number" readonly="1" />
24
- <field name="document_serie" readonly="1" />
25
- </group>
26
-
27
- <group>
28
- <field name="partner_id" readonly="1" />
29
- </group>
30
- </group>
31
- <footer>
32
- <button
33
- name="action_import_and_open_document"
34
- string="Import Fiscal Document"
35
- class="btn-primary"
36
- type="object"
37
- />
38
- <button string="Cancel" class="btn-default" special="cancel" />
39
- </footer>
40
- </form>
41
- </field>
42
- </record>
43
-
44
- </odoo>
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <!-- Copyright 2020 KMEE
3
- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4
- <odoo>
5
-
6
- <record model="ir.ui.view" id="wizard_document_status_form">
7
- <field
8
- name="name"
9
- >wizard.l10n_br_fiscal.base.wizard.mixin (in l10n_br_fiscal)</field>
10
- <field name="model">l10n_br_fiscal.document.status.wizard</field>
11
- <field name="arch" type="xml">
12
- <form string="Document Status">
13
- <field invisible="1" name="state" />
14
- <group name="document_info">
15
- <group name="document_info_right">
16
- <field name="partner_id" readonly="1" />
17
- <field name="document_id" readonly="1" />
18
- </group>
19
- <group name="document_info_left">
20
- <field name="document_type" invisible="1" />
21
- <field name="document_type_id" readonly="1" />
22
- <field name="document_serie" readonly="1" />
23
- <field name="document_number" readonly="1" />
24
- <field
25
- name="rps_number"
26
- attrs="{'invisible': [('document_type', '!=', 'SE')]}"
27
- readonly="1"
28
- />
29
- </group>
30
- </group>
31
- <group name="document_key_group">
32
- <field name="document_key" readonly="1" />
33
- </group>
34
- <group states="done" name="document_status">
35
- <field name="document_status" />
36
- </group>
37
- <footer>
38
- <button
39
- name="doit"
40
- string="Get Status"
41
- class="btn-primary"
42
- type="object"
43
- />
44
- <button string="Close" class="btn-default" special="cancel" />
45
- </footer>
46
- </form>
47
- </field>
48
- </record>
49
-
50
- <record model="ir.actions.act_window" id="wizard_document_status_act_multi">
51
- <field name="name">Document Status</field>
52
- <field name="res_model">l10n_br_fiscal.document.status.wizard</field>
53
- <field name="view_mode">form</field>
54
- <field name="binding_model_id" ref="model_l10n_br_fiscal_document" />
55
- <field name="target">new</field>
56
- </record>
57
-
58
- </odoo>
@@ -1,29 +0,0 @@
1
- # Copyright 2019 KMEE
2
- # Copyright (C) 2020 Renato Lima - Akretion <renato.lima@akretion.com.br>
3
- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4
-
5
- from odoo import models
6
-
7
-
8
- class InvalidateNumberWizard(models.TransientModel):
9
- _name = "l10n_br_fiscal.invalidate.number.wizard"
10
- _description = "Invalidate Number Wizard"
11
- _inherit = "l10n_br_fiscal.base.wizard.mixin"
12
-
13
- def do_invalidate(self):
14
- invalidate = self.env["l10n_br_fiscal.invalidate.number"].create(
15
- {
16
- "company_id": self.document_id.company_id.id,
17
- "document_type_id": self.document_id.document_type_id.id,
18
- "document_serie_id": self.document_id.document_serie_id.id,
19
- "number_start": self.document_id.document_number,
20
- "number_end": self.document_id.document_number,
21
- "justification": self.justification,
22
- }
23
- )
24
- invalidate._invalidate(self.document_id)
25
-
26
- def doit(self):
27
- for wizard in self:
28
- wizard.do_invalidate()
29
- self._close()
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <!-- Copyright 2019 KMEE
3
- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4
- <odoo>
5
-
6
- <record id="invalidate_number_wizard" model="ir.ui.view">
7
- <field name="name">l10n_br_fiscal.invalidate.number.wizard</field>
8
- <field name="model">l10n_br_fiscal.invalidate.number.wizard</field>
9
- <field name="arch" type="xml">
10
- <form string="Inutilização de documento fiscal">
11
- <group>
12
- <field name="justification" />
13
- </group>
14
- <footer>
15
- <button name="doit" string="OK" class="btn-primary" type="object" />
16
- <button string="Cancel" class="btn-default" special="cancel" />
17
- </footer>
18
- </form>
19
- </field>
20
- </record>
21
-
22
- <record id="invalidate_number_wizard_action" model="ir.actions.act_window">
23
- <field name="name">Inutilização de documento fiscal</field>
24
- <field name="res_model">l10n_br_fiscal.invalidate.number.wizard</field>
25
- <field name="view_mode">form</field>
26
- <field name="context">{}</field>
27
- <field name="target">new</field>
28
- </record>
29
-
30
- </odoo>