odoo-addon-l10n-br-fiscal 16.0.8.0.2__py3-none-any.whl → 16.0.19.4.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.
- odoo/addons/l10n_br_fiscal/README.rst +1 -1
- odoo/addons/l10n_br_fiscal/__manifest__.py +10 -3
- odoo/addons/l10n_br_fiscal/constants/fiscal.py +64 -18
- 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.document.type.csv +1 -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/data/operation_data.xml +1 -1
- odoo/addons/l10n_br_fiscal/data/uom_data.xml +186 -33
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_demo.xml +3 -377
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_nfse_demo.xml +0 -12
- odoo/addons/l10n_br_fiscal/demo/fiscal_operation_demo.xml +2 -2
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +902 -304
- odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +22 -22
- odoo/addons/l10n_br_fiscal/migrations/16.0.13.0.0/pre-migration.py +25 -0
- odoo/addons/l10n_br_fiscal/migrations/16.0.14.0.0/pre-migration.py +30 -0
- odoo/addons/l10n_br_fiscal/migrations/16.0.14.0.5/pre-migration.py +15 -0
- odoo/addons/l10n_br_fiscal/models/__init__.py +3 -2
- odoo/addons/l10n_br_fiscal/models/comment.py +2 -2
- odoo/addons/l10n_br_fiscal/models/data_ncm_nbs_abstract.py +1 -1
- odoo/addons/l10n_br_fiscal/models/document.py +83 -226
- odoo/addons/l10n_br_fiscal/models/document_line.py +67 -5
- odoo/addons/l10n_br_fiscal/models/document_line_mixin.py +1932 -136
- odoo/addons/l10n_br_fiscal/models/document_mixin.py +248 -17
- odoo/addons/l10n_br_fiscal/models/document_related.py +11 -8
- odoo/addons/l10n_br_fiscal/models/document_serie.py +33 -0
- odoo/addons/l10n_br_fiscal/models/ibpt.py +1 -1
- odoo/addons/l10n_br_fiscal/models/icms_regulation.py +1 -1
- odoo/addons/l10n_br_fiscal/models/invalidate_number.py +4 -5
- odoo/addons/l10n_br_fiscal/models/operation_dashboard.py +3 -2
- 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/partner_profile.py +6 -0
- odoo/addons/l10n_br_fiscal/models/product_template.py +5 -1
- odoo/addons/l10n_br_fiscal/models/res_company.py +18 -0
- odoo/addons/l10n_br_fiscal/models/res_partner.py +27 -6
- odoo/addons/l10n_br_fiscal/models/simplified_tax_range.py +8 -0
- odoo/addons/l10n_br_fiscal/models/tax.py +7 -3
- odoo/addons/l10n_br_fiscal/models/tax_classification.py +81 -0
- odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_base.py +1 -1
- odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_credit.py +1 -1
- odoo/addons/l10n_br_fiscal/models/uom_uom.py +24 -0
- odoo/addons/l10n_br_fiscal/security/fiscal_security.xml +6 -16
- odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +8 -2
- odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
- odoo/addons/l10n_br_fiscal/tests/__init__.py +3 -0
- odoo/addons/l10n_br_fiscal/tests/test_document_edition.py +308 -0
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +23 -111
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_nfse.py +5 -13
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_serie.py +60 -0
- odoo/addons/l10n_br_fiscal/tests/test_ibpt.py +2 -2
- odoo/addons/l10n_br_fiscal/tests/test_icms_regulation.py +2 -2
- odoo/addons/l10n_br_fiscal/tests/test_tax_benefit.py +14 -20
- odoo/addons/l10n_br_fiscal/tests/test_tax_classification.py +110 -0
- odoo/addons/l10n_br_fiscal/tools.py +1 -1
- odoo/addons/l10n_br_fiscal/views/cest_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/cfop_view.xml +3 -5
- odoo/addons/l10n_br_fiscal/views/city_taxation_code.xml +1 -4
- odoo/addons/l10n_br_fiscal/views/cnae_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/comment_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/cst_view.xml +6 -8
- odoo/addons/l10n_br_fiscal/views/{document_fiscal_line_mixin_view.xml → document_line_mixin_view.xml} +525 -388
- odoo/addons/l10n_br_fiscal/views/document_line_view.xml +101 -82
- odoo/addons/l10n_br_fiscal/views/document_related_view.xml +44 -46
- odoo/addons/l10n_br_fiscal/views/document_serie_view.xml +2 -6
- odoo/addons/l10n_br_fiscal/views/document_type_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/document_view.xml +304 -346
- odoo/addons/l10n_br_fiscal/views/icms_regulation_view.xml +14 -16
- odoo/addons/l10n_br_fiscal/views/icms_relief_view.xml +8 -10
- odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +46 -48
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +162 -244
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +16 -72
- odoo/addons/l10n_br_fiscal/views/legal_nature_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/nbm_view.xml +5 -6
- odoo/addons/l10n_br_fiscal/views/nbs_view.xml +5 -6
- odoo/addons/l10n_br_fiscal/views/ncm_view.xml +12 -15
- odoo/addons/l10n_br_fiscal/views/operation_dashboard_view.xml +13 -12
- odoo/addons/l10n_br_fiscal/views/operation_indicator_view.xml +75 -0
- odoo/addons/l10n_br_fiscal/views/operation_line_view.xml +22 -21
- odoo/addons/l10n_br_fiscal/views/operation_view.xml +3 -6
- odoo/addons/l10n_br_fiscal/views/partner_profile_view.xml +3 -6
- odoo/addons/l10n_br_fiscal/views/product_genre_view.xml +7 -9
- odoo/addons/l10n_br_fiscal/views/product_product_view.xml +37 -14
- odoo/addons/l10n_br_fiscal/views/product_template_view.xml +34 -14
- odoo/addons/l10n_br_fiscal/views/res_company_view.xml +40 -38
- odoo/addons/l10n_br_fiscal/views/res_config_settings_view.xml +23 -28
- odoo/addons/l10n_br_fiscal/views/res_partner_view.xml +13 -2
- odoo/addons/l10n_br_fiscal/views/service_type_view.xml +7 -8
- odoo/addons/l10n_br_fiscal/views/simplified_tax_range_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/simplified_tax_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/tax_classification.xml +110 -0
- odoo/addons/l10n_br_fiscal/views/tax_definition_view.xml +157 -129
- odoo/addons/l10n_br_fiscal/views/tax_estimate_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/tax_group_view.xml +3 -6
- odoo/addons/l10n_br_fiscal/views/tax_ipi_control_seal_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_class_view.xml +0 -2
- odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_base_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_credit_view.xml +2 -4
- odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_view.xml +5 -7
- odoo/addons/l10n_br_fiscal/views/tax_view.xml +5 -7
- odoo/addons/l10n_br_fiscal/views/uom_uom.xml +52 -0
- odoo/addons/l10n_br_fiscal/wizards/__init__.py +1 -0
- odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py +1 -1
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +129 -0
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.xml +41 -0
- {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/METADATA +3 -3
- {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/RECORD +113 -99
- {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/WHEEL +1 -1
- odoo/addons/l10n_br_fiscal/models/document_line_mixin_methods.py +0 -814
- odoo/addons/l10n_br_fiscal/models/document_mixin_methods.py +0 -363
- {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Copyright (C) 2025 Renato Lima - Akretion <renato.lima@akretion.com.br>
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
|
|
4
|
+
from psycopg2 import IntegrityError
|
|
5
|
+
|
|
6
|
+
from odoo.exceptions import ValidationError
|
|
7
|
+
from odoo.tests import TransactionCase
|
|
8
|
+
from odoo.tools import mute_logger
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TestFiscalDocumentSerie(TransactionCase):
|
|
12
|
+
@classmethod
|
|
13
|
+
def setUpClass(cls):
|
|
14
|
+
super().setUpClass()
|
|
15
|
+
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
|
16
|
+
|
|
17
|
+
# Company
|
|
18
|
+
cls.company_sn = cls.env.ref("l10n_br_base.empresa_simples_nacional")
|
|
19
|
+
|
|
20
|
+
# Fiscal Document Type
|
|
21
|
+
cls.document_type_nfe = cls.env.ref("l10n_br_fiscal.document_55")
|
|
22
|
+
|
|
23
|
+
cls.document_serie_nfe_5 = cls.env["l10n_br_fiscal.document.serie"].create(
|
|
24
|
+
{
|
|
25
|
+
"code": "5",
|
|
26
|
+
"name": "Serie 5",
|
|
27
|
+
"document_type_id": cls.document_type_nfe.id,
|
|
28
|
+
"company_id": cls.company_sn.id,
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Fiscal Document
|
|
33
|
+
cls.document = cls.env["l10n_br_fiscal.document"].create(
|
|
34
|
+
{
|
|
35
|
+
"company_id": cls.company_sn.id,
|
|
36
|
+
"document_type_id": cls.document_type_nfe.id,
|
|
37
|
+
"document_serie_id": cls.document_serie_nfe_5.id,
|
|
38
|
+
"partner_id": cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id,
|
|
39
|
+
"state_edoc": "cancelada",
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def test_document_serie_duplicated(self):
|
|
44
|
+
"""Test document serie duplicate constraint."""
|
|
45
|
+
document_serie = self.env["l10n_br_fiscal.document.serie"]
|
|
46
|
+
document_serie_values = {
|
|
47
|
+
"code": "10",
|
|
48
|
+
"name": "Serie 10",
|
|
49
|
+
"document_type_id": self.document_type_nfe.id,
|
|
50
|
+
"company_id": self.company_sn.id,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
with self.assertRaises(IntegrityError), mute_logger("odoo.sql_db"):
|
|
54
|
+
for _ in range(2):
|
|
55
|
+
document_serie.create(document_serie_values)
|
|
56
|
+
|
|
57
|
+
def test_document_serie_code_in_use(self):
|
|
58
|
+
"""Test document serie code in use constraint."""
|
|
59
|
+
with self.assertRaises(ValidationError):
|
|
60
|
+
self.document_serie_nfe_5.write({"code": "7"})
|
|
@@ -108,7 +108,7 @@ class TestIbpt(TransactionCase):
|
|
|
108
108
|
try:
|
|
109
109
|
config = DeOlhoNoImposto(
|
|
110
110
|
company.ibpt_token,
|
|
111
|
-
misc.punctuation_rm(company.
|
|
111
|
+
misc.punctuation_rm(company.vat),
|
|
112
112
|
company.state_id.code,
|
|
113
113
|
odooconfig.get("ibpt_request_timeout")
|
|
114
114
|
or cls.env["ir.config_parameter"]
|
|
@@ -131,7 +131,7 @@ class TestIbpt(TransactionCase):
|
|
|
131
131
|
company = cls.env["res.company"].create(
|
|
132
132
|
{
|
|
133
133
|
"name": "Company Test Fiscal BR",
|
|
134
|
-
"
|
|
134
|
+
"vat": "02.960.895/0002-12",
|
|
135
135
|
"country_id": cls.env.ref("base.br").id,
|
|
136
136
|
"state_id": cls.env.ref("base.state_br_es").id,
|
|
137
137
|
"ibpt_api": True,
|
|
@@ -61,8 +61,8 @@ class TestICMSRegulation(TransactionCase):
|
|
|
61
61
|
|
|
62
62
|
def find_icms_tax(self, in_state_id, out_state_id, ncm_id, ind_final):
|
|
63
63
|
self.partner.state_id = in_state_id
|
|
64
|
-
self.company.partner_id.
|
|
65
|
-
self.company.
|
|
64
|
+
self.company.partner_id.l10n_br_ie_code = False
|
|
65
|
+
self.company.l10n_br_ie_code = False
|
|
66
66
|
self.company.state_id = out_state_id
|
|
67
67
|
self.product.ncm_id = ncm_id
|
|
68
68
|
|
|
@@ -6,15 +6,16 @@ from odoo.tests import TransactionCase
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class TestTaxBenefit(TransactionCase):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
@classmethod
|
|
10
|
+
def setUpClass(cls):
|
|
11
|
+
super().setUpClass()
|
|
12
|
+
cls.nfe_tax_benefit = cls.env.ref("l10n_br_fiscal.demo_nfe_tax_benefit")
|
|
13
|
+
cls.tax_benefit = cls.env["l10n_br_fiscal.tax.definition"].create(
|
|
13
14
|
{
|
|
14
|
-
"icms_regulation_id":
|
|
15
|
+
"icms_regulation_id": cls.env.ref(
|
|
15
16
|
"l10n_br_fiscal.tax_icms_regulation"
|
|
16
17
|
).id,
|
|
17
|
-
"tax_group_id":
|
|
18
|
+
"tax_group_id": cls.env.ref("l10n_br_fiscal.tax_group_icms").id,
|
|
18
19
|
"code": "SP810001",
|
|
19
20
|
"name": "TAX BENEFIT DEMO",
|
|
20
21
|
"description": "TAX BENEFIT DEMO",
|
|
@@ -23,30 +24,23 @@ class TestTaxBenefit(TransactionCase):
|
|
|
23
24
|
"is_taxed": True,
|
|
24
25
|
"is_debit_credit": True,
|
|
25
26
|
"custom_tax": True,
|
|
26
|
-
"tax_id":
|
|
27
|
-
"cst_id":
|
|
28
|
-
"state_from_id":
|
|
29
|
-
"state_to_ids": [Command.set(
|
|
27
|
+
"tax_id": cls.env.ref("l10n_br_fiscal.tax_icms_12_red_26_57").id,
|
|
28
|
+
"cst_id": cls.env.ref("l10n_br_fiscal.cst_icms_20").id,
|
|
29
|
+
"state_from_id": cls.env.ref("base.state_br_sp").id,
|
|
30
|
+
"state_to_ids": [Command.set(cls.env.ref("base.state_br_mg").ids)],
|
|
30
31
|
"ncms": "73269090",
|
|
31
32
|
"ncm_ids": [
|
|
32
|
-
Command.set(
|
|
33
|
+
Command.set(cls.env.ref("l10n_br_fiscal.ncm_73269090").ids)
|
|
33
34
|
],
|
|
34
35
|
"state": "approved",
|
|
35
36
|
}
|
|
36
37
|
)
|
|
38
|
+
# force update
|
|
39
|
+
cls.nfe_tax_benefit.fiscal_line_ids._compute_fiscal_tax_ids()
|
|
37
40
|
|
|
38
41
|
def test_nfe_tax_benefit(self):
|
|
39
42
|
"""Test NFe with tax benefit."""
|
|
40
|
-
|
|
41
|
-
self.nfe_tax_benefit._onchange_fiscal_operation_id()
|
|
42
|
-
|
|
43
43
|
for line in self.nfe_tax_benefit.fiscal_line_ids:
|
|
44
|
-
line._onchange_product_id_fiscal()
|
|
45
|
-
line._onchange_commercial_quantity()
|
|
46
|
-
line._onchange_fiscal_operation_id()
|
|
47
|
-
line._onchange_fiscal_operation_line_id()
|
|
48
|
-
line._onchange_fiscal_taxes()
|
|
49
|
-
|
|
50
44
|
self.assertEqual(
|
|
51
45
|
line.icms_tax_benefit_id,
|
|
52
46
|
self.tax_benefit,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from odoo.tests import TransactionCase
|
|
2
|
+
from odoo.tests.common import Form, tagged
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@tagged("post_install", "-at_install")
|
|
6
|
+
class TestTaxClassification(TransactionCase):
|
|
7
|
+
@classmethod
|
|
8
|
+
def setUpClass(cls):
|
|
9
|
+
super().setUpClass()
|
|
10
|
+
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
|
11
|
+
|
|
12
|
+
cls.company = cls.env.ref("l10n_br_base.empresa_lucro_presumido")
|
|
13
|
+
cls.partner = cls.env.ref("l10n_br_base.res_partner_cliente1_sp")
|
|
14
|
+
cls.product = cls.env.ref("product.product_product_6")
|
|
15
|
+
|
|
16
|
+
# Use a stable operation line already referenced in existing test suites.
|
|
17
|
+
cls.operation_line = cls.env.ref("l10n_br_fiscal.fo_venda_venda")
|
|
18
|
+
|
|
19
|
+
# Pick classifications with CBS/IBS taxes set in the provided CSV.
|
|
20
|
+
cls.classification_company = cls.env.ref(
|
|
21
|
+
"l10n_br_fiscal.tax_classification_000001"
|
|
22
|
+
)
|
|
23
|
+
cls.classification_line = cls.env.ref(
|
|
24
|
+
"l10n_br_fiscal.tax_classification_200001"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def _map_kwargs(self):
|
|
28
|
+
return {
|
|
29
|
+
"company": self.company,
|
|
30
|
+
"partner": self.partner,
|
|
31
|
+
"product": self.product,
|
|
32
|
+
"ncm": self.product.ncm_id,
|
|
33
|
+
"nbm": self.env["l10n_br_fiscal.nbm"],
|
|
34
|
+
"nbs": self.env["l10n_br_fiscal.nbs"],
|
|
35
|
+
"cest": self.env["l10n_br_fiscal.cest"],
|
|
36
|
+
"city_taxation_code": self.env["l10n_br_fiscal.city.taxation.code"],
|
|
37
|
+
"service_type": self.env["l10n_br_fiscal.service.type"],
|
|
38
|
+
"ind_final": "1",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
def test_map_fiscal_taxes_tax_classification_from_company(self):
|
|
42
|
+
"""Operation line must fallback to company tax classification when empty."""
|
|
43
|
+
self.company.tax_classification_id = self.classification_company
|
|
44
|
+
self.operation_line.tax_classification_id = False
|
|
45
|
+
|
|
46
|
+
result = self.operation_line.map_fiscal_taxes(**self._map_kwargs())
|
|
47
|
+
|
|
48
|
+
self.assertEqual(result["tax_classification"], self.classification_company)
|
|
49
|
+
self.assertEqual(
|
|
50
|
+
result["taxes"][self.classification_company.tax_cbs_id.tax_domain],
|
|
51
|
+
self.classification_company.tax_cbs_id,
|
|
52
|
+
)
|
|
53
|
+
self.assertEqual(
|
|
54
|
+
result["taxes"][self.classification_company.tax_ibs_id.tax_domain],
|
|
55
|
+
self.classification_company.tax_ibs_id,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def test_map_fiscal_taxes_tax_classification_from_operation_line(self):
|
|
59
|
+
"""Operation line tax classification must override company default."""
|
|
60
|
+
self.company.tax_classification_id = self.classification_company
|
|
61
|
+
self.operation_line.tax_classification_id = self.classification_line
|
|
62
|
+
|
|
63
|
+
result = self.operation_line.map_fiscal_taxes(**self._map_kwargs())
|
|
64
|
+
|
|
65
|
+
self.assertEqual(result["tax_classification"], self.classification_line)
|
|
66
|
+
self.assertEqual(
|
|
67
|
+
result["taxes"][self.classification_line.tax_cbs_id.tax_domain],
|
|
68
|
+
self.classification_line.tax_cbs_id,
|
|
69
|
+
)
|
|
70
|
+
self.assertEqual(
|
|
71
|
+
result["taxes"][self.classification_line.tax_ibs_id.tax_domain],
|
|
72
|
+
self.classification_line.tax_ibs_id,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
def test_document_line_receives_cbs_ibs_from_tax_classification(self):
|
|
76
|
+
"""Fiscal document line must receive tax classification and CBS/IBS taxes."""
|
|
77
|
+
self.company.tax_classification_id = self.classification_company
|
|
78
|
+
self.operation_line.tax_classification_id = False
|
|
79
|
+
|
|
80
|
+
doc_form = Form(
|
|
81
|
+
self.env["l10n_br_fiscal.document"].with_context(
|
|
82
|
+
default_fiscal_operation_type="out",
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
doc_form.company_id = self.company
|
|
86
|
+
doc_form.partner_id = self.partner
|
|
87
|
+
doc_form.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
|
|
88
|
+
doc_form.ind_final = "1"
|
|
89
|
+
|
|
90
|
+
with doc_form.fiscal_line_ids.new() as line_form:
|
|
91
|
+
line_form.product_id = self.product
|
|
92
|
+
# Ensure we map on a predictable operation line for this assertion.
|
|
93
|
+
line_form.fiscal_operation_line_id = self.operation_line
|
|
94
|
+
|
|
95
|
+
self.assertEqual(
|
|
96
|
+
line_form.tax_classification_id, self.classification_company
|
|
97
|
+
)
|
|
98
|
+
self.assertEqual(
|
|
99
|
+
line_form.cbs_tax_id, self.classification_company.tax_cbs_id
|
|
100
|
+
)
|
|
101
|
+
self.assertEqual(
|
|
102
|
+
line_form.ibs_tax_id, self.classification_company.tax_ibs_id
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
self.assertIn(
|
|
106
|
+
self.classification_company.tax_cbs_id, line_form.fiscal_tax_ids
|
|
107
|
+
)
|
|
108
|
+
self.assertIn(
|
|
109
|
+
self.classification_company.tax_ibs_id, line_form.fiscal_tax_ids
|
|
110
|
+
)
|
|
@@ -48,7 +48,7 @@ def domain_field_codes(
|
|
|
48
48
|
def path_edoc_company(company_id):
|
|
49
49
|
db_name = company_id._cr.dbname
|
|
50
50
|
filestore = tools.config.filestore(db_name)
|
|
51
|
-
return "/".join([filestore, "edoc", punctuation_rm(company_id.
|
|
51
|
+
return "/".join([filestore, "edoc", punctuation_rm(company_id.vat)])
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
def build_edoc_path(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<record id="cest_search" model="ir.ui.view">
|
|
5
4
|
<field name="name">l10n_br_fiscal.cest.search</field>
|
|
6
5
|
<field name="model">l10n_br_fiscal.cest</field>
|
|
@@ -10,9 +9,9 @@
|
|
|
10
9
|
<field name="name" />
|
|
11
10
|
<field name="item" />
|
|
12
11
|
<field name="segment" />
|
|
13
|
-
<group expand=
|
|
12
|
+
<group expand="0" string="Group By...">
|
|
14
13
|
<filter
|
|
15
|
-
string=
|
|
14
|
+
string="Segment"
|
|
16
15
|
name="segment"
|
|
17
16
|
domain="[]"
|
|
18
17
|
context="{'group_by' : 'segment'}"
|
|
@@ -79,5 +78,4 @@
|
|
|
79
78
|
</form>
|
|
80
79
|
</field>
|
|
81
80
|
</record>
|
|
82
|
-
|
|
83
81
|
</odoo>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<record id="cfop_search" model="ir.ui.view">
|
|
5
4
|
<field name="name">l10n_br_fiscal.cfop.search</field>
|
|
6
5
|
<field name="model">l10n_br_fiscal.cfop</field>
|
|
@@ -25,15 +24,15 @@
|
|
|
25
24
|
<field name="code" />
|
|
26
25
|
<field name="name" />
|
|
27
26
|
<field name="small_name" />
|
|
28
|
-
<group expand=
|
|
27
|
+
<group expand="0" string="Group By...">
|
|
29
28
|
<filter
|
|
30
|
-
string=
|
|
29
|
+
string="Type In Out"
|
|
31
30
|
name="type_in_out"
|
|
32
31
|
domain="[]"
|
|
33
32
|
context="{'group_by' : 'type_in_out'}"
|
|
34
33
|
/>
|
|
35
34
|
<filter
|
|
36
|
-
string=
|
|
35
|
+
string="Type Move"
|
|
37
36
|
name="type_move"
|
|
38
37
|
domain="[]"
|
|
39
38
|
context="{'group_by' : 'type_move'}"
|
|
@@ -116,5 +115,4 @@
|
|
|
116
115
|
</form>
|
|
117
116
|
</field>
|
|
118
117
|
</record>
|
|
119
|
-
|
|
120
118
|
</odoo>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<!-- Copyright 2020 KMEE INFORMATICA LTDA
|
|
3
3
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
|
|
6
5
|
<record id="city_taxation_code_search_view" model="ir.ui.view">
|
|
7
6
|
<field name="name">city.taxation.code.search (in l10n_br_fiscal)</field>
|
|
8
7
|
<field name="model">l10n_br_fiscal.city.taxation.code</field>
|
|
@@ -38,8 +37,7 @@
|
|
|
38
37
|
<field name="model">l10n_br_fiscal.city.taxation.code</field>
|
|
39
38
|
<field name="arch" type="xml">
|
|
40
39
|
<form>
|
|
41
|
-
<header
|
|
42
|
-
</header>
|
|
40
|
+
<header />
|
|
43
41
|
<sheet>
|
|
44
42
|
<group>
|
|
45
43
|
<field name="code" />
|
|
@@ -53,5 +51,4 @@
|
|
|
53
51
|
</form>
|
|
54
52
|
</field>
|
|
55
53
|
</record>
|
|
56
|
-
|
|
57
54
|
</odoo>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<record id="cnae_search" model="ir.ui.view">
|
|
5
4
|
<field name="name">l10n_br_fiscal.cnae.search</field>
|
|
6
5
|
<field name="model">l10n_br_fiscal.cnae</field>
|
|
@@ -8,9 +7,9 @@
|
|
|
8
7
|
<search string="CNAE">
|
|
9
8
|
<field name="code" />
|
|
10
9
|
<field name="name" />
|
|
11
|
-
<group expand=
|
|
10
|
+
<group expand="0" string="Group By...">
|
|
12
11
|
<filter
|
|
13
|
-
string=
|
|
12
|
+
string="Parent"
|
|
14
13
|
name="parent_id"
|
|
15
14
|
domain="[]"
|
|
16
15
|
context="{'group_by' : 'parent_id'}"
|
|
@@ -51,5 +50,4 @@
|
|
|
51
50
|
</form>
|
|
52
51
|
</field>
|
|
53
52
|
</record>
|
|
54
|
-
|
|
55
53
|
</odoo>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<record id="comment_search" model="ir.ui.view">
|
|
5
4
|
<field name="name">l10n_br_fiscal.comment.search</field>
|
|
6
5
|
<field name="model">l10n_br_fiscal.comment</field>
|
|
7
6
|
<field name="arch" type="xml">
|
|
8
7
|
<search string="Comment">
|
|
9
8
|
<field name="name" />
|
|
10
|
-
<group expand=
|
|
9
|
+
<group expand="0" string="Group By...">
|
|
11
10
|
<filter
|
|
12
|
-
string=
|
|
11
|
+
string="Comment Type"
|
|
13
12
|
name="comment_type"
|
|
14
13
|
domain="[]"
|
|
15
14
|
context="{'group_by' : 'comment_type'}"
|
|
@@ -75,5 +74,4 @@
|
|
|
75
74
|
</form>
|
|
76
75
|
</field>
|
|
77
76
|
</record>
|
|
78
|
-
|
|
79
77
|
</odoo>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
|
|
4
3
|
<record id="cst_search" model="ir.ui.view">
|
|
5
4
|
<field name="name">l10n_br_fiscal.cst.search</field>
|
|
6
5
|
<field name="model">l10n_br_fiscal.cst</field>
|
|
@@ -10,9 +9,9 @@
|
|
|
10
9
|
<field name="name" />
|
|
11
10
|
<field name="tax_group_id" />
|
|
12
11
|
<field name="tax_domain" />
|
|
13
|
-
<group expand=
|
|
12
|
+
<group expand="0" string="Group By...">
|
|
14
13
|
<filter
|
|
15
|
-
string=
|
|
14
|
+
string="Tax Group"
|
|
16
15
|
name="tax_group_id"
|
|
17
16
|
domain="[]"
|
|
18
17
|
context="{'group_by' : 'tax_group_id'}"
|
|
@@ -42,14 +41,13 @@
|
|
|
42
41
|
<form string="CST">
|
|
43
42
|
<sheet>
|
|
44
43
|
<group>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
<field name="code" />
|
|
45
|
+
<field name="name" />
|
|
46
|
+
<field name="cst_type" />
|
|
47
|
+
<field name="tax_group_id" />
|
|
49
48
|
</group>
|
|
50
49
|
</sheet>
|
|
51
50
|
</form>
|
|
52
51
|
</field>
|
|
53
52
|
</record>
|
|
54
|
-
|
|
55
53
|
</odoo>
|