odoo-addon-l10n-br-fiscal 17.0.1.0.0.11__py3-none-any.whl → 18.0.1.0.0.6__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 +10 -10
- odoo/addons/l10n_br_fiscal/__init__.py +1 -0
- odoo/addons/l10n_br_fiscal/__manifest__.py +2 -1
- odoo/addons/l10n_br_fiscal/constants/fiscal.py +5 -6
- odoo/addons/l10n_br_fiscal/data/ir_cron.xml +19 -34
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal_cfop_data.xml +0 -2
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal_data.xml +6 -8
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal_icms_tax_definition_data.xml +4055 -4033
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal_server_action.xml +0 -2
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal_tax_icms_data.xml +54 -50
- odoo/addons/l10n_br_fiscal/data/operation_data.xml +197 -181
- odoo/addons/l10n_br_fiscal/data/product_data.xml +0 -2
- odoo/addons/l10n_br_fiscal/data/res_partner_data.xml +0 -2
- odoo/addons/l10n_br_fiscal/data/simplified_tax_data.xml +0 -2
- odoo/addons/l10n_br_fiscal/data/uom_data.xml +0 -2
- odoo/addons/l10n_br_fiscal/demo/city_taxation_code_demo.xml +0 -2
- odoo/addons/l10n_br_fiscal/demo/company_demo.xml +0 -3
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_demo.xml +37 -49
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_nfse_demo.xml +0 -1
- odoo/addons/l10n_br_fiscal/demo/fiscal_operation_demo.xml +0 -2
- odoo/addons/l10n_br_fiscal/demo/icms_tax_definition_demo.xml +0 -2
- odoo/addons/l10n_br_fiscal/demo/partner_demo.xml +0 -2
- odoo/addons/l10n_br_fiscal/demo/product_demo.xml +0 -1705
- odoo/addons/l10n_br_fiscal/demo/res_users_demo.xml +0 -2
- odoo/addons/l10n_br_fiscal/hooks.py +68 -0
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +27 -164
- odoo/addons/l10n_br_fiscal/models/cfop.py +1 -1
- odoo/addons/l10n_br_fiscal/models/cnae.py +2 -2
- odoo/addons/l10n_br_fiscal/models/comment.py +9 -26
- odoo/addons/l10n_br_fiscal/models/cst.py +2 -2
- odoo/addons/l10n_br_fiscal/models/data_abstract.py +11 -24
- odoo/addons/l10n_br_fiscal/models/document.py +0 -1
- odoo/addons/l10n_br_fiscal/models/document_mixin.py +0 -2
- odoo/addons/l10n_br_fiscal/models/document_serie.py +2 -2
- odoo/addons/l10n_br_fiscal/models/document_type.py +0 -1
- odoo/addons/l10n_br_fiscal/models/ibpt.py +1 -1
- odoo/addons/l10n_br_fiscal/models/invalidate_number.py +6 -7
- odoo/addons/l10n_br_fiscal/models/legal_nature.py +1 -1
- odoo/addons/l10n_br_fiscal/models/nbm.py +2 -2
- odoo/addons/l10n_br_fiscal/models/nbs.py +4 -4
- odoo/addons/l10n_br_fiscal/models/ncm.py +4 -4
- odoo/addons/l10n_br_fiscal/models/operation.py +2 -2
- odoo/addons/l10n_br_fiscal/models/operation_dashboard.py +1 -1
- odoo/addons/l10n_br_fiscal/models/operation_line.py +1 -1
- odoo/addons/l10n_br_fiscal/models/partner_profile.py +1 -1
- odoo/addons/l10n_br_fiscal/models/tax.py +5 -1
- odoo/addons/l10n_br_fiscal/models/tax_group.py +6 -6
- odoo/addons/l10n_br_fiscal/models/tax_pis_cofins.py +4 -4
- odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_base.py +2 -2
- odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_credit.py +2 -2
- odoo/addons/l10n_br_fiscal/security/fiscal_security.xml +0 -2
- odoo/addons/l10n_br_fiscal/static/description/index.html +8 -8
- odoo/addons/l10n_br_fiscal/tests/test_document_edition.py +26 -5
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +3 -2
- odoo/addons/l10n_br_fiscal/views/cest_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/cfop_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/city_taxation_code.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/cnae_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/comment_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/cst_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/document_related_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/document_serie_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/document_type_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/document_view.xml +9 -14
- odoo/addons/l10n_br_fiscal/views/icms_regulation_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/icms_relief_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +36 -36
- odoo/addons/l10n_br_fiscal/views/legal_nature_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/nbm_view.xml +5 -5
- odoo/addons/l10n_br_fiscal/views/nbs_view.xml +5 -5
- odoo/addons/l10n_br_fiscal/views/ncm_view.xml +5 -5
- odoo/addons/l10n_br_fiscal/views/operation_dashboard_view.xml +7 -8
- odoo/addons/l10n_br_fiscal/views/operation_line_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/operation_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/partner_profile_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/product_genre_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/product_product_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/product_template_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/res_config_settings_view.xml +8 -8
- odoo/addons/l10n_br_fiscal/views/service_type_view.xml +5 -5
- odoo/addons/l10n_br_fiscal/views/simplified_tax_range_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/simplified_tax_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/tax_definition_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/tax_estimate_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_group_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_ipi_control_seal_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_class_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_base_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_credit_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/uom_uom.xml +2 -2
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.11.dist-info → odoo_addon_l10n_br_fiscal-18.0.1.0.0.6.dist-info}/METADATA +15 -15
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.11.dist-info → odoo_addon_l10n_br_fiscal-18.0.1.0.0.6.dist-info}/RECORD +98 -97
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.11.dist-info → odoo_addon_l10n_br_fiscal-18.0.1.0.0.6.dist-info}/WHEEL +0 -0
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.11.dist-info → odoo_addon_l10n_br_fiscal-18.0.1.0.0.6.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Copyright (C) 2014 KMEE - www.kmee.com.br
|
|
3
3
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
4
4
|
|
|
5
|
-
from odoo import
|
|
5
|
+
from odoo import fields, models
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Cnae(models.Model):
|
|
@@ -34,6 +34,6 @@ class Cnae(models.Model):
|
|
|
34
34
|
(
|
|
35
35
|
"fiscal_cnae_code_uniq",
|
|
36
36
|
"unique (code)",
|
|
37
|
-
|
|
37
|
+
"CNAE already exists with this code!",
|
|
38
38
|
)
|
|
39
39
|
]
|
|
@@ -6,8 +6,7 @@ from datetime import datetime
|
|
|
6
6
|
|
|
7
7
|
from dateutil.relativedelta import relativedelta
|
|
8
8
|
|
|
9
|
-
from odoo import api, fields, models
|
|
10
|
-
from odoo.osv import expression
|
|
9
|
+
from odoo import api, fields, models
|
|
11
10
|
|
|
12
11
|
from ..constants.fiscal import (
|
|
13
12
|
COMMENT_TYPE,
|
|
@@ -62,29 +61,13 @@ class Comment(models.Model):
|
|
|
62
61
|
)
|
|
63
62
|
|
|
64
63
|
@api.model
|
|
65
|
-
def
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
("comment", "ilike", "%" + name + "%"),
|
|
73
|
-
("name", operator, name),
|
|
74
|
-
],
|
|
75
|
-
]
|
|
76
|
-
)
|
|
77
|
-
return super()._search(
|
|
78
|
-
domain,
|
|
79
|
-
limit=limit,
|
|
80
|
-
)
|
|
81
|
-
return super()._name_search(
|
|
82
|
-
name=name,
|
|
83
|
-
domain=domain,
|
|
84
|
-
operator=operator,
|
|
85
|
-
limit=limit,
|
|
86
|
-
order=order,
|
|
87
|
-
)
|
|
64
|
+
def _search_display_name(self, operator, value):
|
|
65
|
+
name = value or ""
|
|
66
|
+
return [
|
|
67
|
+
"|",
|
|
68
|
+
("comment", "ilike", "%" + name + "%"),
|
|
69
|
+
("name", operator, name),
|
|
70
|
+
]
|
|
88
71
|
|
|
89
72
|
@api.depends("comment")
|
|
90
73
|
def _compute_display_name(self):
|
|
@@ -165,7 +148,7 @@ class Comment(models.Model):
|
|
|
165
148
|
|
|
166
149
|
comments = [manual_comment] if manual_comment else []
|
|
167
150
|
for record in self:
|
|
168
|
-
template = mako_safe_env.from_string(
|
|
151
|
+
template = mako_safe_env.from_string(record.comment)
|
|
169
152
|
comments.append(template.render(vals))
|
|
170
153
|
return " - ".join(comments)
|
|
171
154
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2018 Renato Lima - Akretion
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
from ..constants.fiscal import FISCAL_IN_OUT_ALL
|
|
7
7
|
|
|
@@ -34,6 +34,6 @@ class CST(models.Model):
|
|
|
34
34
|
(
|
|
35
35
|
"l10n_br_fiscal_cst_code_tax_group_id_uniq",
|
|
36
36
|
"unique (code, tax_group_id)",
|
|
37
|
-
|
|
37
|
+
"CST already exists with this code!",
|
|
38
38
|
)
|
|
39
39
|
]
|
|
@@ -8,7 +8,6 @@ from lxml import etree
|
|
|
8
8
|
|
|
9
9
|
from odoo import _, api, fields, models
|
|
10
10
|
from odoo.exceptions import AccessError
|
|
11
|
-
from odoo.osv import expression
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
class DataAbstract(models.AbstractModel):
|
|
@@ -23,7 +22,7 @@ class DataAbstract(models.AbstractModel):
|
|
|
23
22
|
- Enhanced search: Modifies search views and `_name_search`
|
|
24
23
|
to allow searching by `code`, `code_unmasked`, and `name`
|
|
25
24
|
simultaneously.
|
|
26
|
-
- Standardized display name format in `
|
|
25
|
+
- Standardized display name format in `display_name`
|
|
27
26
|
(`<code> - <name>`).
|
|
28
27
|
- Permission control for archiving/unarchanging, restricted
|
|
29
28
|
to users in 'l10n_br_fiscal.group_manager' group.
|
|
@@ -89,30 +88,18 @@ class DataAbstract(models.AbstractModel):
|
|
|
89
88
|
return model_view
|
|
90
89
|
|
|
91
90
|
@api.model
|
|
92
|
-
def
|
|
91
|
+
def _search_display_name(self, operator, value):
|
|
92
|
+
name = value or ""
|
|
93
93
|
if operator == "ilike" and not (name or "").strip():
|
|
94
|
-
|
|
94
|
+
return []
|
|
95
95
|
elif operator in ("ilike", "like", "=", "=like", "=ilike"):
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
("code", operator, name),
|
|
104
|
-
("code_unmasked", "ilike", name + "%"),
|
|
105
|
-
],
|
|
106
|
-
]
|
|
107
|
-
)
|
|
108
|
-
return self._search(
|
|
109
|
-
domain,
|
|
110
|
-
limit=limit,
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
return super()._name_search(
|
|
114
|
-
name, domain=domain, operator=operator, limit=limit, order=order
|
|
115
|
-
)
|
|
96
|
+
return [
|
|
97
|
+
"|",
|
|
98
|
+
"|",
|
|
99
|
+
("name", operator, name),
|
|
100
|
+
("code", operator, name),
|
|
101
|
+
("code_unmasked", "ilike", name + "%"),
|
|
102
|
+
]
|
|
116
103
|
|
|
117
104
|
@api.depends("name", "code")
|
|
118
105
|
def _compute_display_name(self):
|
|
@@ -501,14 +501,12 @@ class FiscalDocumentMixin(models.AbstractModel):
|
|
|
501
501
|
document_number = fields.Char(
|
|
502
502
|
copy=False,
|
|
503
503
|
index=True,
|
|
504
|
-
unaccent=False,
|
|
505
504
|
)
|
|
506
505
|
|
|
507
506
|
document_key = fields.Char(
|
|
508
507
|
string="Key",
|
|
509
508
|
copy=False,
|
|
510
509
|
index=True,
|
|
511
|
-
unaccent=False,
|
|
512
510
|
)
|
|
513
511
|
|
|
514
512
|
key_random_code = fields.Char(string="Document Key Random Code")
|
|
@@ -16,9 +16,9 @@ class DocumentSerie(models.Model):
|
|
|
16
16
|
_description = "Fiscal Document Serie"
|
|
17
17
|
_inherit = "l10n_br_fiscal.data.abstract"
|
|
18
18
|
|
|
19
|
-
code = fields.Char(size=3
|
|
19
|
+
code = fields.Char(size=3)
|
|
20
20
|
|
|
21
|
-
name = fields.Char(required=True
|
|
21
|
+
name = fields.Char(required=True)
|
|
22
22
|
|
|
23
23
|
active = fields.Boolean(default=True)
|
|
24
24
|
|
|
@@ -45,7 +45,7 @@ def _request(ws_url, params, ibpt_request_timeout=30):
|
|
|
45
45
|
elif response.status_code == requests.codes.service_unavailable:
|
|
46
46
|
raise UserError(_("IBPT Service Unavailable - {!r}").format(ws_url))
|
|
47
47
|
except Exception as e:
|
|
48
|
-
raise UserError(
|
|
48
|
+
raise UserError(f"Error in the request: {e}") from e
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
def get_ibpt_product(
|
|
@@ -68,8 +68,8 @@ class InvalidateNumber(models.Model):
|
|
|
68
68
|
|
|
69
69
|
state = fields.Selection(
|
|
70
70
|
selection=[
|
|
71
|
-
("draft",
|
|
72
|
-
("done",
|
|
71
|
+
("draft", "Draft"),
|
|
72
|
+
("done", "Done"),
|
|
73
73
|
],
|
|
74
74
|
string="Status",
|
|
75
75
|
readonly=True,
|
|
@@ -99,11 +99,10 @@ class InvalidateNumber(models.Model):
|
|
|
99
99
|
@api.depends("document_type_id", "document_serie_id", "number_start", "number_end")
|
|
100
100
|
def _compute_name(self):
|
|
101
101
|
for record in self:
|
|
102
|
-
record.name =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
end=record.number_end,
|
|
102
|
+
record.name = (
|
|
103
|
+
f"{record.document_type_id.type}/"
|
|
104
|
+
f"({record.document_serie_id.name}): "
|
|
105
|
+
f"{record.number_start} - {record.number_end}"
|
|
107
106
|
)
|
|
108
107
|
|
|
109
108
|
def unlink(self):
|
|
@@ -11,9 +11,9 @@ class Nbm(models.Model):
|
|
|
11
11
|
_inherit = "l10n_br_fiscal.data.product.abstract"
|
|
12
12
|
_description = "NBM"
|
|
13
13
|
|
|
14
|
-
code = fields.Char(size=12
|
|
14
|
+
code = fields.Char(size=12)
|
|
15
15
|
|
|
16
|
-
code_unmasked = fields.Char(size=10
|
|
16
|
+
code_unmasked = fields.Char(size=10)
|
|
17
17
|
|
|
18
18
|
product_tmpl_ids = fields.One2many(inverse_name="nbm_id")
|
|
19
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2019 Renato Lima - Akretion
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
from .ibpt import get_ibpt_service
|
|
7
7
|
|
|
@@ -15,9 +15,9 @@ class Nbs(models.Model):
|
|
|
15
15
|
]
|
|
16
16
|
_description = "NBS"
|
|
17
17
|
|
|
18
|
-
code = fields.Char(size=12
|
|
18
|
+
code = fields.Char(size=12)
|
|
19
19
|
|
|
20
|
-
code_unmasked = fields.Char(size=10
|
|
20
|
+
code_unmasked = fields.Char(size=10)
|
|
21
21
|
|
|
22
22
|
tax_estimate_ids = fields.One2many(inverse_name="nbs_id")
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ class Nbs(models.Model):
|
|
|
27
27
|
(
|
|
28
28
|
"fiscal_nbs_code_uniq",
|
|
29
29
|
"unique (code)",
|
|
30
|
-
|
|
30
|
+
"NBS already exists with this code!",
|
|
31
31
|
)
|
|
32
32
|
]
|
|
33
33
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2012 Renato Lima - Akretion <renato.lima@akretion.com.br>
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
from ..constants.fiscal import TAX_DOMAIN_II, TAX_DOMAIN_IPI
|
|
7
7
|
from .ibpt import get_ibpt_product
|
|
@@ -16,9 +16,9 @@ class Ncm(models.Model):
|
|
|
16
16
|
]
|
|
17
17
|
_description = "NCM"
|
|
18
18
|
|
|
19
|
-
code = fields.Char(size=10
|
|
19
|
+
code = fields.Char(size=10)
|
|
20
20
|
|
|
21
|
-
code_unmasked = fields.Char(size=8
|
|
21
|
+
code_unmasked = fields.Char(size=8)
|
|
22
22
|
|
|
23
23
|
exception = fields.Char(size=2)
|
|
24
24
|
|
|
@@ -70,7 +70,7 @@ class Ncm(models.Model):
|
|
|
70
70
|
(
|
|
71
71
|
"fiscal_ncm_code_exception_uniq",
|
|
72
72
|
"unique (code, exception)",
|
|
73
|
-
|
|
73
|
+
"NCM already exists with this code!",
|
|
74
74
|
)
|
|
75
75
|
]
|
|
76
76
|
|
|
@@ -98,7 +98,7 @@ class Operation(models.Model):
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
default_price_unit = fields.Selection(
|
|
101
|
-
selection=[("sale_price",
|
|
101
|
+
selection=[("sale_price", "Sale Price"), ("cost_price", "Cost Price")],
|
|
102
102
|
string="Default Price Unit?",
|
|
103
103
|
default="sale_price",
|
|
104
104
|
readonly=True,
|
|
@@ -173,7 +173,7 @@ class Operation(models.Model):
|
|
|
173
173
|
(
|
|
174
174
|
"fiscal_operation_code_uniq",
|
|
175
175
|
"unique (code)",
|
|
176
|
-
|
|
176
|
+
"Fiscal Operation already exists with this code!",
|
|
177
177
|
)
|
|
178
178
|
]
|
|
179
179
|
|
|
@@ -157,7 +157,7 @@ class Operation(models.Model):
|
|
|
157
157
|
}
|
|
158
158
|
)
|
|
159
159
|
|
|
160
|
-
[action] = self.env.ref("l10n_br_fiscal
|
|
160
|
+
[action] = self.env.ref("l10n_br_fiscal.{action_name}").read()
|
|
161
161
|
action["context"] = ctx
|
|
162
162
|
action["domain"] = self._context.get("use_domain", [])
|
|
163
163
|
action["domain"] += [
|
|
@@ -139,7 +139,7 @@ class OperationLine(models.Model):
|
|
|
139
139
|
(
|
|
140
140
|
"fiscal_operation_name_uniq",
|
|
141
141
|
"unique (name, fiscal_operation_id)",
|
|
142
|
-
|
|
142
|
+
"Fiscal Operation Line already exists with this name!",
|
|
143
143
|
)
|
|
144
144
|
]
|
|
145
145
|
|
|
@@ -226,7 +226,11 @@ class Tax(models.Model):
|
|
|
226
226
|
)
|
|
227
227
|
|
|
228
228
|
_sql_constraints = [
|
|
229
|
-
(
|
|
229
|
+
(
|
|
230
|
+
"fiscal_tax_code_uniq",
|
|
231
|
+
"unique (name)",
|
|
232
|
+
"Tax already exists with this name!",
|
|
233
|
+
)
|
|
230
234
|
]
|
|
231
235
|
|
|
232
236
|
@api.model
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2019 Renato Lima - Akretion <renato.lima@akretion.com.br>
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
from ..constants.fiscal import TAX_DOMAIN
|
|
7
7
|
|
|
@@ -29,10 +29,10 @@ class TaxGroup(models.Model):
|
|
|
29
29
|
|
|
30
30
|
tax_scope = fields.Selection(
|
|
31
31
|
selection=[
|
|
32
|
-
("city",
|
|
33
|
-
("state",
|
|
34
|
-
("federal",
|
|
35
|
-
("other",
|
|
32
|
+
("city", "City"),
|
|
33
|
+
("state", "State"),
|
|
34
|
+
("federal", "Federal"),
|
|
35
|
+
("other", "Other"),
|
|
36
36
|
],
|
|
37
37
|
required=True,
|
|
38
38
|
)
|
|
@@ -75,6 +75,6 @@ class TaxGroup(models.Model):
|
|
|
75
75
|
(
|
|
76
76
|
"fiscal_tax_group_code_uniq",
|
|
77
77
|
"unique (name)",
|
|
78
|
-
|
|
78
|
+
"Tax Group already exists with this name!",
|
|
79
79
|
)
|
|
80
80
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2019 Renato Lima - Akretion <renato.lima@akretion.com.br>
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import api, fields, models
|
|
5
5
|
|
|
6
6
|
from .. import tools
|
|
7
7
|
from ..constants.fiscal import (
|
|
@@ -22,9 +22,9 @@ class TaxPisCofins(models.Model):
|
|
|
22
22
|
|
|
23
23
|
piscofins_type = fields.Selection(
|
|
24
24
|
selection=[
|
|
25
|
-
("ncm",
|
|
26
|
-
("product",
|
|
27
|
-
("company",
|
|
25
|
+
("ncm", "NCM"),
|
|
26
|
+
("product", "Product"),
|
|
27
|
+
("company", "Company"),
|
|
28
28
|
],
|
|
29
29
|
default="ncm",
|
|
30
30
|
string="Type",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2019 Renato Lima - Akretion
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TaxPisCofinsBase(models.Model):
|
|
@@ -15,6 +15,6 @@ class TaxPisCofinsBase(models.Model):
|
|
|
15
15
|
(
|
|
16
16
|
"l10n_br_fiscal_tax_pis_cofins_base_uniq",
|
|
17
17
|
"unique (code)",
|
|
18
|
-
|
|
18
|
+
"Already exists with this code!",
|
|
19
19
|
)
|
|
20
20
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (C) 2019 Renato Lima - Akretion
|
|
2
2
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import fields, models
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TaxPisCofinsCredit(models.Model):
|
|
@@ -15,6 +15,6 @@ class TaxPisCofinsCredit(models.Model):
|
|
|
15
15
|
(
|
|
16
16
|
"l10n_br_fiscal_tax_pis_cofins_code_uniq",
|
|
17
17
|
"unique (code)",
|
|
18
|
-
|
|
18
|
+
"Already exists with this code!",
|
|
19
19
|
)
|
|
20
20
|
]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo noupdate="1">
|
|
3
|
-
|
|
4
3
|
<record id="module_category_l10n_br_fiscal_management" model="ir.module.category">
|
|
5
4
|
<field name="name">Brazilian Fiscal</field>
|
|
6
5
|
<field
|
|
@@ -79,5 +78,4 @@
|
|
|
79
78
|
name="domain_force"
|
|
80
79
|
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
81
80
|
</record>
|
|
82
|
-
|
|
83
81
|
</odoo>
|
|
@@ -372,10 +372,10 @@ ul.auto-toc {
|
|
|
372
372
|
!! This file is generated by oca-gen-addon-readme !!
|
|
373
373
|
!! changes will be overwritten. !!
|
|
374
374
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
375
|
-
!! source digest: sha256:
|
|
375
|
+
!! source digest: sha256:0a81c278185fba9ee231db553d75d0193012c162e10738ae9013f1a562b11ad0
|
|
376
376
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
377
|
-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/
|
|
378
|
-
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/l10n-brazil/
|
|
377
|
+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/18.0/l10n_br_fiscal"><img alt="OCA/l10n-brazil" src="https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-brazil-18-0/l10n-brazil-18-0-l10n_br_fiscal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
378
|
+
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/l10n-brazil/18.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" /></p>
|
|
379
379
|
<div class="section" id="classificacoes-fiscais">
|
|
380
380
|
<h2>Classificações fiscais</h2>
|
|
381
381
|
<p>Primeramente, este módulo traz uma variedade de cadastros fiscais para
|
|
@@ -513,8 +513,8 @@ como:</p>
|
|
|
513
513
|
<li>ST</li>
|
|
514
514
|
<li>retenções</li>
|
|
515
515
|
</ul>
|
|
516
|
-
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/l10n-brazil/
|
|
517
|
-
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/l10n-brazil/
|
|
516
|
+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/l10n-brazil/18.0/l10n_br_fiscal/static/img/fiscal_line.png" /></p>
|
|
517
|
+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/l10n-brazil/18.0/l10n_br_fiscal/static/img/fiscal_total.png" /></p>
|
|
518
518
|
<p>É notório que o cálculo dos impostos no Brasil é muito especial e muito
|
|
519
519
|
trabalhoso. Geralmente é o motivo pelo qual os ERPs internacionais não
|
|
520
520
|
tem grande fatia de mercado brasileiro.</p>
|
|
@@ -543,7 +543,7 @@ Tributária)…</p>
|
|
|
543
543
|
<div class="section" id="operacoes-fiscais">
|
|
544
544
|
<h2>Operações fiscais</h2>
|
|
545
545
|
<blockquote>
|
|
546
|
-
<img alt="image3" src="https://raw.githubusercontent.com/OCA/l10n-brazil/
|
|
546
|
+
<img alt="image3" src="https://raw.githubusercontent.com/OCA/l10n-brazil/18.0/l10n_br_fiscal/static/img/fiscal_operation.png" /></blockquote>
|
|
547
547
|
<p>No Odoo nativo, o conceito mais parecido com a operação fiscal e o
|
|
548
548
|
<tt class="docutils literal">account.fiscal.position</tt>. E ate a versão 10.0, era o que a gente
|
|
549
549
|
usava. Porém, a posição fiscal do Odoo não resolve muito os nossos
|
|
@@ -610,7 +610,7 @@ l10n_br_sale, l10n_br_purchase…</p>
|
|
|
610
610
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-brazil/issues">GitHub Issues</a>.
|
|
611
611
|
In case of trouble, please check there if your issue has already been reported.
|
|
612
612
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
613
|
-
<a class="reference external" href="https://github.com/OCA/l10n-brazil/issues/new?body=module:%20l10n_br_fiscal%0Aversion:%
|
|
613
|
+
<a class="reference external" href="https://github.com/OCA/l10n-brazil/issues/new?body=module:%20l10n_br_fiscal%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
614
614
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
615
615
|
</div>
|
|
616
616
|
<div class="section" id="credits">
|
|
@@ -659,7 +659,7 @@ mission is to support the collaborative development of Odoo features and
|
|
|
659
659
|
promote its widespread use.</p>
|
|
660
660
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
|
|
661
661
|
<p><a class="reference external image-reference" href="https://github.com/renatonlima"><img alt="renatonlima" src="https://github.com/renatonlima.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/rvalyi"><img alt="rvalyi" src="https://github.com/rvalyi.png?size=40px" /></a></p>
|
|
662
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-brazil/tree/
|
|
662
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-brazil/tree/18.0/l10n_br_fiscal">OCA/l10n-brazil</a> project on GitHub.</p>
|
|
663
663
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
664
664
|
</div>
|
|
665
665
|
</div>
|
|
@@ -3,15 +3,38 @@
|
|
|
3
3
|
|
|
4
4
|
from unittest import mock
|
|
5
5
|
|
|
6
|
-
from odoo
|
|
7
|
-
from odoo.tests
|
|
6
|
+
from odoo import Command
|
|
7
|
+
from odoo.tests import Form, TransactionCase
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class TestDocumentEdition(TransactionCase):
|
|
11
11
|
@classmethod
|
|
12
12
|
def setUpClass(cls):
|
|
13
13
|
super().setUpClass()
|
|
14
|
-
cls.
|
|
14
|
+
cls.user = cls.env["res.users"].create(
|
|
15
|
+
{
|
|
16
|
+
"name": "Fiscal User",
|
|
17
|
+
"login": "fiscaluser",
|
|
18
|
+
"password": "fiscaluser",
|
|
19
|
+
"groups_id": [
|
|
20
|
+
Command.set(cls.env.user.groups_id.ids),
|
|
21
|
+
Command.link(cls.env.ref("l10n_br_fiscal.group_user").id),
|
|
22
|
+
Command.link(cls.env.ref("base.group_multi_company").id),
|
|
23
|
+
],
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
cls.user.partner_id.email = "accountman@test.com"
|
|
27
|
+
companies = cls.env["res.company"].search([])
|
|
28
|
+
cls.user.write(
|
|
29
|
+
{
|
|
30
|
+
"company_ids": [Command.set(companies.ids)],
|
|
31
|
+
"company_id": cls.env.ref("l10n_br_base.empresa_lucro_presumido"),
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
cls.env = cls.env(
|
|
36
|
+
user=cls.user, context=dict(cls.env.context, tracking_disable=True)
|
|
37
|
+
)
|
|
15
38
|
|
|
16
39
|
def test_basic_doc_edition(self):
|
|
17
40
|
doc_form = Form(
|
|
@@ -96,7 +119,6 @@ class TestDocumentEdition(TransactionCase):
|
|
|
96
119
|
default_fiscal_operation_type="out",
|
|
97
120
|
)
|
|
98
121
|
)
|
|
99
|
-
doc_form.company_id = self.env.ref("l10n_br_base.empresa_lucro_presumido")
|
|
100
122
|
doc_form.partner_id = self.env.ref("l10n_br_base.res_partner_cliente1_sp")
|
|
101
123
|
doc_form.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
|
|
102
124
|
doc_form.ind_final = "1"
|
|
@@ -119,7 +141,6 @@ class TestDocumentEdition(TransactionCase):
|
|
|
119
141
|
default_fiscal_operation_type="out",
|
|
120
142
|
)
|
|
121
143
|
)
|
|
122
|
-
doc_form.company_id = self.env.ref("l10n_br_base.empresa_lucro_presumido")
|
|
123
144
|
doc_form.partner_id = self.env.ref("l10n_br_base.res_partner_cliente1_sp")
|
|
124
145
|
doc_form.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
|
|
125
146
|
doc_form.ind_final = "1"
|
|
@@ -77,9 +77,10 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
77
77
|
# ICMS
|
|
78
78
|
self.assertTrue(
|
|
79
79
|
is_icms_internal,
|
|
80
|
-
"Error to mapping ICMS Inernal for
|
|
80
|
+
"Error to mapping ICMS Inernal for "
|
|
81
|
+
f"{self.nfe_same_state.partner_id.state_id.name}"
|
|
81
82
|
" for Venda de Contribuinte Dentro do "
|
|
82
|
-
"Estado."
|
|
83
|
+
"Estado.",
|
|
83
84
|
)
|
|
84
85
|
self.assertEqual(
|
|
85
86
|
line.icms_cst_id.code,
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
<field name="name">l10n_br_fiscal.cest.tree</field>
|
|
26
26
|
<field name="model">l10n_br_fiscal.cest</field>
|
|
27
27
|
<field name="arch" type="xml">
|
|
28
|
-
<
|
|
28
|
+
<list>
|
|
29
29
|
<field name="code" />
|
|
30
30
|
<field name="item" />
|
|
31
31
|
<field name="name" />
|
|
32
32
|
<field name="segment" />
|
|
33
|
-
</
|
|
33
|
+
</list>
|
|
34
34
|
</field>
|
|
35
35
|
</record>
|
|
36
36
|
|