odoo-addon-l10n-br-fiscal 17.0.1.0.0.13__py3-none-any.whl → 17.0.4.0.0.1__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 +1 -1
- odoo/addons/l10n_br_fiscal/constants/fiscal.py +0 -20
- odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.document.type.csv +1 -0
- odoo/addons/l10n_br_fiscal/data/operation_data.xml +1 -1
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_demo.xml +3 -91
- odoo/addons/l10n_br_fiscal/demo/fiscal_document_nfse_demo.xml +0 -4
- odoo/addons/l10n_br_fiscal/demo/fiscal_operation_demo.xml +2 -2
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +78 -54
- odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +91 -60
- odoo/addons/l10n_br_fiscal/migrations/17.0.2.0.0/pre-migration.py +25 -0
- odoo/addons/l10n_br_fiscal/migrations/17.0.3.0.0/pre-migration.py +30 -0
- odoo/addons/l10n_br_fiscal/models/comment.py +2 -2
- odoo/addons/l10n_br_fiscal/models/document.py +31 -6
- odoo/addons/l10n_br_fiscal/models/document_line.py +49 -2
- odoo/addons/l10n_br_fiscal/models/document_line_mixin.py +63 -19
- odoo/addons/l10n_br_fiscal/models/document_line_mixin_methods.py +99 -68
- odoo/addons/l10n_br_fiscal/models/document_mixin.py +3 -12
- odoo/addons/l10n_br_fiscal/models/document_mixin_methods.py +33 -169
- odoo/addons/l10n_br_fiscal/models/document_related.py +1 -1
- 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 +1 -1
- odoo/addons/l10n_br_fiscal/models/product_template.py +1 -1
- odoo/addons/l10n_br_fiscal/models/res_partner.py +4 -0
- odoo/addons/l10n_br_fiscal/models/tax.py +7 -3
- 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/security/fiscal_security.xml +6 -16
- odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +1 -2
- 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_document_edition.py +138 -0
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +3 -13
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_nfse.py +0 -1
- odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_serie.py +60 -0
- odoo/addons/l10n_br_fiscal/tests/test_tax_benefit.py +0 -1
- odoo/addons/l10n_br_fiscal/views/document_line_mixin_view.xml +0 -1
- odoo/addons/l10n_br_fiscal/views/document_line_view.xml +6 -4
- odoo/addons/l10n_br_fiscal/views/document_view.xml +10 -14
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +0 -9
- odoo/addons/l10n_br_fiscal/views/operation_dashboard_view.xml +3 -3
- odoo/addons/l10n_br_fiscal/views/product_product_view.xml +1 -1
- odoo/addons/l10n_br_fiscal/views/product_template_view.xml +1 -1
- odoo/addons/l10n_br_fiscal/views/res_partner_view.xml +3 -0
- odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py +1 -1
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info → odoo_addon_l10n_br_fiscal-17.0.4.0.0.1.dist-info}/METADATA +2 -2
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info → odoo_addon_l10n_br_fiscal-17.0.4.0.0.1.dist-info}/RECORD +52 -49
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info → odoo_addon_l10n_br_fiscal-17.0.4.0.0.1.dist-info}/WHEEL +0 -0
- {odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info → odoo_addon_l10n_br_fiscal-17.0.4.0.0.1.dist-info}/top_level.txt +0 -0
|
@@ -12,6 +12,10 @@ class TestDocumentEdition(TransactionCase):
|
|
|
12
12
|
def setUpClass(cls):
|
|
13
13
|
super().setUpClass()
|
|
14
14
|
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
|
15
|
+
cls.user = cls.env.user
|
|
16
|
+
cls.company = cls.env.ref("l10n_br_base.empresa_lucro_presumido")
|
|
17
|
+
cls.user.company_ids |= cls.company
|
|
18
|
+
cls.user.company_id = cls.company.id
|
|
15
19
|
|
|
16
20
|
def test_basic_doc_edition(self):
|
|
17
21
|
doc_form = Form(
|
|
@@ -141,3 +145,137 @@ class TestDocumentEdition(TransactionCase):
|
|
|
141
145
|
self.assertEqual(doc.fiscal_line_ids[0].fiscal_price, 112)
|
|
142
146
|
self.assertEqual(doc.fiscal_line_ids[0].quantity, 10)
|
|
143
147
|
self.assertEqual(doc.fiscal_line_ids[0].fiscal_quantity, 5)
|
|
148
|
+
|
|
149
|
+
def test_landed_costs_by_line_and_by_total(self):
|
|
150
|
+
"""
|
|
151
|
+
Tests both landed cost scenarios: 'by line' and 'by total'.
|
|
152
|
+
1. By Line: Enters costs on lines and verifies the header totals.
|
|
153
|
+
2. By Total: Enters costs on the header and verifies lines distribution.
|
|
154
|
+
"""
|
|
155
|
+
self.env.user.groups_id |= self.env.ref("l10n_br_fiscal.group_user")
|
|
156
|
+
product1 = self.env.ref("product.product_product_6")
|
|
157
|
+
product2 = self.env.ref("product.product_product_7")
|
|
158
|
+
|
|
159
|
+
# Part 1: Test with delivery_costs = 'line'
|
|
160
|
+
# ----------------------------------------------------
|
|
161
|
+
self.company.delivery_costs = "line"
|
|
162
|
+
doc_form = Form(self.env["l10n_br_fiscal.document"])
|
|
163
|
+
doc_form.company_id = self.company
|
|
164
|
+
doc_form.partner_id = self.env.ref("l10n_br_base.res_partner_cliente1_sp")
|
|
165
|
+
doc_form.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
|
|
166
|
+
|
|
167
|
+
with doc_form.fiscal_line_ids.new() as line1:
|
|
168
|
+
line1.product_id = product1
|
|
169
|
+
line1.fiscal_operation_line_id = self.env.ref(
|
|
170
|
+
"l10n_br_fiscal.fo_venda_venda"
|
|
171
|
+
)
|
|
172
|
+
line1.price_unit = 1000.0
|
|
173
|
+
line1.quantity = 2.0 # Gross: 2000
|
|
174
|
+
line1.freight_value = 10.0
|
|
175
|
+
line1.insurance_value = 20.0
|
|
176
|
+
line1.other_value = 5.0
|
|
177
|
+
|
|
178
|
+
with doc_form.fiscal_line_ids.new() as line2:
|
|
179
|
+
line2.product_id = product2
|
|
180
|
+
line2.fiscal_operation_line_id = self.env.ref(
|
|
181
|
+
"l10n_br_fiscal.fo_venda_venda"
|
|
182
|
+
)
|
|
183
|
+
line2.price_unit = 500.0
|
|
184
|
+
line2.quantity = 1.0 # Gross: 500
|
|
185
|
+
line2.freight_value = 4.0
|
|
186
|
+
line2.insurance_value = 6.0
|
|
187
|
+
line2.other_value = 2.0
|
|
188
|
+
|
|
189
|
+
doc = doc_form.save()
|
|
190
|
+
|
|
191
|
+
self.assertEqual(doc.company_id.delivery_costs, "line")
|
|
192
|
+
# Assert header totals are the SUM of line values
|
|
193
|
+
self.assertAlmostEqual(doc.amount_freight_value, 14.0) # 10.0 + 4.0
|
|
194
|
+
self.assertAlmostEqual(doc.amount_insurance_value, 26.0) # 20.0 + 6.0
|
|
195
|
+
self.assertAlmostEqual(doc.amount_other_value, 7.0) # 5.0 + 2.0
|
|
196
|
+
|
|
197
|
+
# Assert final fiscal totals (bottom-up calculation)
|
|
198
|
+
# price_gross = (1000*2) + (500*1) = 2500
|
|
199
|
+
# landed_costs = 14 + 26 + 7 = 47
|
|
200
|
+
# fiscal_amount_untaxed (IPI Base) = 2500 + 47 = 2547
|
|
201
|
+
self.assertAlmostEqual(doc.fiscal_amount_untaxed, 2547.00)
|
|
202
|
+
# fiscal_amount_tax (IPI) = (2035 * 3.25%) + (512 * 5%) = 66.14 + 25.60 = 91.74
|
|
203
|
+
self.assertAlmostEqual(doc.fiscal_amount_tax, 91.74, places=2)
|
|
204
|
+
# fiscal_amount_total = 2547.00 + 91.74 = 2638.74
|
|
205
|
+
self.assertAlmostEqual(doc.fiscal_amount_total, 2638.74, places=2)
|
|
206
|
+
|
|
207
|
+
# Part 2: Test with delivery_costs = 'total'
|
|
208
|
+
# ----------------------------------------------------
|
|
209
|
+
self.company.delivery_costs = "total"
|
|
210
|
+
doc_form_edit = Form(doc)
|
|
211
|
+
# Set new header totals, which should trigger inverse methods to distribute
|
|
212
|
+
doc_form_edit.amount_freight_value = 30.0
|
|
213
|
+
doc_form_edit.amount_insurance_value = 60.0
|
|
214
|
+
doc_form_edit.amount_other_value = 90.0
|
|
215
|
+
doc_after_total_update = doc_form_edit.save()
|
|
216
|
+
|
|
217
|
+
line1 = doc_after_total_update.fiscal_line_ids[0]
|
|
218
|
+
line2 = doc_after_total_update.fiscal_line_ids[1]
|
|
219
|
+
|
|
220
|
+
# Assert values were distributed proportionally to price_gross
|
|
221
|
+
# (2000 vs 500 -> 80% vs 20%)
|
|
222
|
+
# Freight: 30.0 * 0.8 = 24.0 | 30.0 * 0.2 = 6.0
|
|
223
|
+
self.assertAlmostEqual(line1.freight_value, 24.0)
|
|
224
|
+
self.assertAlmostEqual(line2.freight_value, 6.0)
|
|
225
|
+
# Insurance: 60.0 * 0.8 = 48.0 | 60.0 * 0.2 = 12.0
|
|
226
|
+
self.assertAlmostEqual(line1.insurance_value, 48.0)
|
|
227
|
+
self.assertAlmostEqual(line2.insurance_value, 12.0)
|
|
228
|
+
# Other: 90.0 * 0.8 = 72.0 | 90.0 * 0.2 = 18.0
|
|
229
|
+
self.assertAlmostEqual(line1.other_value, 72.0)
|
|
230
|
+
self.assertAlmostEqual(line2.other_value, 18.0)
|
|
231
|
+
|
|
232
|
+
# Assert final fiscal totals are recomputed correctly (top-down calculation)
|
|
233
|
+
# price_gross = 2500
|
|
234
|
+
# landed_costs = 30 + 60 + 90 = 180
|
|
235
|
+
# fiscal_amount_untaxed (IPI Base) = 2500 + 180 = 2680
|
|
236
|
+
self.assertAlmostEqual(doc_after_total_update.fiscal_amount_untaxed, 2680.00)
|
|
237
|
+
# Line 1 IPI Base = 2000 (product) + 24 (freight) + 48 (insurance)
|
|
238
|
+
# + 72 (other) = 2144
|
|
239
|
+
# Line 1 IPI Value = 2144 * 3.25% = 69.68
|
|
240
|
+
self.assertAlmostEqual(line1.ipi_base, 2144.00)
|
|
241
|
+
self.assertAlmostEqual(line1.ipi_value, 69.68, places=2)
|
|
242
|
+
|
|
243
|
+
# Line 2 IPI Base = 500 (product) + 6 (freight) + 12 (insurance)
|
|
244
|
+
# + 18 (other) = 536
|
|
245
|
+
# Line 2 IPI Value = 536 * 5% = 26.80
|
|
246
|
+
self.assertAlmostEqual(line2.ipi_base, 536.00)
|
|
247
|
+
self.assertAlmostEqual(line2.ipi_value, 26.80, places=2)
|
|
248
|
+
|
|
249
|
+
# fiscal_amount_tax (IPI) = 69.68 + 26.80 = 96.48
|
|
250
|
+
self.assertAlmostEqual(
|
|
251
|
+
doc_after_total_update.fiscal_amount_tax, 96.48, places=2
|
|
252
|
+
)
|
|
253
|
+
# fiscal_amount_total = 2680.00 + 96.48 = 2776.48
|
|
254
|
+
self.assertAlmostEqual(
|
|
255
|
+
doc_after_total_update.fiscal_amount_total, 2776.48, places=2
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def test_difal_calculation(self):
|
|
259
|
+
partner = self.env.ref("l10n_br_base.res_partner_cliente5_pe")
|
|
260
|
+
partner.ind_ie_dest = "9"
|
|
261
|
+
doc_form = Form(
|
|
262
|
+
self.env["l10n_br_fiscal.document"].with_context(
|
|
263
|
+
default_fiscal_operation_type="out",
|
|
264
|
+
)
|
|
265
|
+
)
|
|
266
|
+
doc_form.company_id = self.company
|
|
267
|
+
doc_form.partner_id = partner
|
|
268
|
+
doc_form.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
|
|
269
|
+
|
|
270
|
+
product = self.env.ref("product.product_product_6")
|
|
271
|
+
with doc_form.fiscal_line_ids.new() as line_form:
|
|
272
|
+
line_form.product_id = product
|
|
273
|
+
line_form.price_unit = 100.0
|
|
274
|
+
line_form.quantity = 1.0
|
|
275
|
+
|
|
276
|
+
doc = doc_form.save()
|
|
277
|
+
line = doc.fiscal_line_ids[0]
|
|
278
|
+
self.assertEqual(line.icms_destination_base, 100.0)
|
|
279
|
+
self.assertEqual(line.icms_origin_percent, 7.0)
|
|
280
|
+
self.assertEqual(line.icms_destination_percent, 20.5)
|
|
281
|
+
self.assertEqual(line.icms_destination_value, 13.5)
|
|
@@ -40,8 +40,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
40
40
|
def test_nfe_same_state(self):
|
|
41
41
|
"""Test NFe same state."""
|
|
42
42
|
for line in self.nfe_same_state.fiscal_line_ids:
|
|
43
|
-
line._onchange_product_id_fiscal()
|
|
44
|
-
|
|
45
43
|
# Restore the original price_unit value,
|
|
46
44
|
# as the product change might have altered it.
|
|
47
45
|
line.price_unit = 100
|
|
@@ -77,9 +75,10 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
77
75
|
# ICMS
|
|
78
76
|
self.assertTrue(
|
|
79
77
|
is_icms_internal,
|
|
80
|
-
"Error to mapping ICMS Inernal for
|
|
78
|
+
"Error to mapping ICMS Inernal for "
|
|
79
|
+
f"{self.nfe_same_state.partner_id.state_id.name}"
|
|
81
80
|
" for Venda de Contribuinte Dentro do "
|
|
82
|
-
"Estado."
|
|
81
|
+
"Estado.",
|
|
83
82
|
)
|
|
84
83
|
self.assertEqual(
|
|
85
84
|
line.icms_cst_id.code,
|
|
@@ -162,7 +161,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
162
161
|
def test_nfe_other_state(self):
|
|
163
162
|
"""Test NFe other state."""
|
|
164
163
|
for line in self.nfe_other_state.fiscal_line_ids:
|
|
165
|
-
line._onchange_product_id_fiscal()
|
|
166
164
|
line._onchange_fiscal_operation_id()
|
|
167
165
|
line._onchange_fiscal_taxes()
|
|
168
166
|
|
|
@@ -277,7 +275,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
277
275
|
def test_nfe_not_taxpayer(self):
|
|
278
276
|
"""Test NFe not taxpayer."""
|
|
279
277
|
for line in self.nfe_not_taxpayer.fiscal_line_ids:
|
|
280
|
-
line._onchange_product_id_fiscal()
|
|
281
278
|
line._onchange_fiscal_operation_id()
|
|
282
279
|
line._onchange_fiscal_taxes()
|
|
283
280
|
|
|
@@ -379,7 +376,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
379
376
|
def test_nfe_not_taxpayer_not_company(self):
|
|
380
377
|
"""Test NFe not taxpayer not Company."""
|
|
381
378
|
for line in self.nfe_not_taxpayer_pf.fiscal_line_ids:
|
|
382
|
-
line._onchange_product_id_fiscal()
|
|
383
379
|
line._onchange_fiscal_operation_id()
|
|
384
380
|
line._onchange_fiscal_taxes()
|
|
385
381
|
|
|
@@ -481,7 +477,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
481
477
|
def test_nfe_export(self):
|
|
482
478
|
"""Test NFe export."""
|
|
483
479
|
for line in self.nfe_export.fiscal_line_ids:
|
|
484
|
-
line._onchange_product_id_fiscal()
|
|
485
480
|
line._onchange_fiscal_operation_id()
|
|
486
481
|
line._onchange_fiscal_taxes()
|
|
487
482
|
|
|
@@ -575,8 +570,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
575
570
|
def test_nfe_sn_same_state(self):
|
|
576
571
|
"""Test NFe Simples Nacional same state."""
|
|
577
572
|
for line in self.nfe_sn_same_state.fiscal_line_ids:
|
|
578
|
-
line._onchange_product_id_fiscal()
|
|
579
|
-
|
|
580
573
|
# set fake estimate tax
|
|
581
574
|
line.ncm_id.tax_estimate_ids.create(
|
|
582
575
|
{
|
|
@@ -688,7 +681,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
688
681
|
def test_nfe_sn_other_state(self):
|
|
689
682
|
"""Test NFe SN other state."""
|
|
690
683
|
for line in self.nfe_sn_other_state.fiscal_line_ids:
|
|
691
|
-
line._onchange_product_id_fiscal()
|
|
692
684
|
line._onchange_fiscal_operation_id()
|
|
693
685
|
line._onchange_fiscal_taxes()
|
|
694
686
|
|
|
@@ -786,7 +778,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
786
778
|
def test_nfe_sn_not_taxpayer(self):
|
|
787
779
|
"""Test NFe SN not taxpayer."""
|
|
788
780
|
for line in self.nfe_sn_not_taxpayer.fiscal_line_ids:
|
|
789
|
-
line._onchange_product_id_fiscal()
|
|
790
781
|
line._onchange_fiscal_operation_id()
|
|
791
782
|
line._onchange_fiscal_taxes()
|
|
792
783
|
|
|
@@ -871,7 +862,6 @@ class TestFiscalDocumentGeneric(TransactionCase):
|
|
|
871
862
|
def test_nfe_sn_export(self):
|
|
872
863
|
"""Test NFe SN export."""
|
|
873
864
|
for line in self.nfe_sn_export.fiscal_line_ids:
|
|
874
|
-
line._onchange_product_id_fiscal()
|
|
875
865
|
line._onchange_fiscal_operation_id()
|
|
876
866
|
line._onchange_fiscal_taxes()
|
|
877
867
|
|
|
@@ -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"})
|
|
@@ -102,19 +102,21 @@
|
|
|
102
102
|
<page name="amounts" string="Amounts">
|
|
103
103
|
<group>
|
|
104
104
|
<group>
|
|
105
|
-
<field name="
|
|
105
|
+
<field name="fiscal_amount_untaxed" />
|
|
106
106
|
<field name="amount_fiscal" />
|
|
107
|
-
<field name="
|
|
107
|
+
<field name="fiscal_amount_tax" />
|
|
108
108
|
<field name="estimate_tax" />
|
|
109
109
|
</group>
|
|
110
110
|
<group>
|
|
111
|
-
<field name="
|
|
111
|
+
<field name="fiscal_amount_total" />
|
|
112
112
|
<field name="amount_tax_withholding" />
|
|
113
113
|
<field name="amount_taxed" />
|
|
114
114
|
</group>
|
|
115
115
|
</group>
|
|
116
116
|
</page>
|
|
117
|
-
<page name="fiscal_line_extra_info" string="Extra Info"
|
|
117
|
+
<page name="fiscal_line_extra_info" string="Extra Info">
|
|
118
|
+
<field name="additional_data" readonly="1" />
|
|
119
|
+
</page>
|
|
118
120
|
</notebook>
|
|
119
121
|
</form>
|
|
120
122
|
</field>
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
<field name="document_date" />
|
|
72
72
|
<field name="fiscal_operation_id" />
|
|
73
73
|
<field name="partner_id" />
|
|
74
|
-
<field name="
|
|
75
|
-
<field name="
|
|
76
|
-
<field name="
|
|
74
|
+
<field name="fiscal_amount_untaxed" />
|
|
75
|
+
<field name="fiscal_amount_tax" />
|
|
76
|
+
<field name="fiscal_amount_total" />
|
|
77
77
|
<field name="state" column_invisible="True" />
|
|
78
78
|
<field
|
|
79
79
|
name="state_edoc"
|
|
@@ -234,7 +234,10 @@
|
|
|
234
234
|
/>
|
|
235
235
|
<field name="partner_shipping_id" />
|
|
236
236
|
</group>
|
|
237
|
-
<group
|
|
237
|
+
<group
|
|
238
|
+
name="l10n_br_fiscal"
|
|
239
|
+
invisible="document_type in ('57', '08', '09', '10', '11', '26', '67', '8B')"
|
|
240
|
+
>
|
|
238
241
|
<field
|
|
239
242
|
name="fiscal_operation_id"
|
|
240
243
|
options="{'no_create': True, 'no_create_edit': True}"
|
|
@@ -292,13 +295,6 @@
|
|
|
292
295
|
/>
|
|
293
296
|
<field name="company_id" invisible="1" />
|
|
294
297
|
</group>
|
|
295
|
-
<group
|
|
296
|
-
name="CT-e Info"
|
|
297
|
-
invisible="[('document_type_id.code', 'in', ['57', '08', '09', '10', '11', '26', '67', '8B'])]"
|
|
298
|
-
>
|
|
299
|
-
<field name="transport_modal" />
|
|
300
|
-
<field name="service_provider" />
|
|
301
|
-
</group>
|
|
302
298
|
</group>
|
|
303
299
|
<notebook>
|
|
304
300
|
<page name="products" string="Products and Services">
|
|
@@ -315,7 +311,7 @@
|
|
|
315
311
|
name="fiscal_tax_ids"
|
|
316
312
|
widget="many2many_tags"
|
|
317
313
|
/>
|
|
318
|
-
<field name="
|
|
314
|
+
<field name="fiscal_amount_total" sum="Total" />
|
|
319
315
|
</tree>
|
|
320
316
|
</field>
|
|
321
317
|
</page>
|
|
@@ -413,8 +409,8 @@
|
|
|
413
409
|
readonly="delivery_costs == 'line' and not force_compute_delivery_costs_by_total"
|
|
414
410
|
/>
|
|
415
411
|
<field name="amount_estimate_tax" />
|
|
416
|
-
<field name="
|
|
417
|
-
<field name="
|
|
412
|
+
<field name="fiscal_amount_tax" />
|
|
413
|
+
<field name="fiscal_amount_total" />
|
|
418
414
|
<field name="amount_tax_withholding" />
|
|
419
415
|
<field name="amount_financial_total" />
|
|
420
416
|
<field name="amount_financial_total_gross" />
|
|
@@ -75,15 +75,6 @@
|
|
|
75
75
|
parent="document_sub_menu"
|
|
76
76
|
sequence="20"
|
|
77
77
|
/>
|
|
78
|
-
<!-- All Documents -->
|
|
79
|
-
<menuitem
|
|
80
|
-
id="document_all_menu"
|
|
81
|
-
action="document_all_action"
|
|
82
|
-
name="All low level Documents"
|
|
83
|
-
groups="l10n_br_fiscal.group_user,l10n_br_fiscal.group_manager"
|
|
84
|
-
parent="document_sub_menu"
|
|
85
|
-
sequence="30"
|
|
86
|
-
/>
|
|
87
78
|
<!-- Partners -->
|
|
88
79
|
<menuitem
|
|
89
80
|
id="partners_menu"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<span title="A enviar">
|
|
88
88
|
<t
|
|
89
89
|
t-esc="dashboard.number_2confirm"
|
|
90
|
-
/>A enviar</span>
|
|
90
|
+
/> A enviar</span>
|
|
91
91
|
</a>
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
>
|
|
102
102
|
<t
|
|
103
103
|
t-esc="dashboard.number_authorized"
|
|
104
|
-
/>Autorizados</a>
|
|
104
|
+
/> Autorizados</a>
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
<div class="row">
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
<span title="Cancelados">
|
|
115
115
|
<t
|
|
116
116
|
t-esc="dashboard.number_cancelled"
|
|
117
|
-
/>Cancelados</span>
|
|
117
|
+
/> Cancelados</span>
|
|
118
118
|
</a>
|
|
119
119
|
</div>
|
|
120
120
|
</div>
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
<field name="model">res.partner</field>
|
|
6
6
|
<field name="inherit_id" ref="l10n_br_base.l10n_br_base_partner_form" />
|
|
7
7
|
<field name="arch" type="xml">
|
|
8
|
+
<group name="other_infos" position="inside">
|
|
9
|
+
<field name="rntrc_code" />
|
|
10
|
+
</group>
|
|
8
11
|
<group name="fiscal_numbers" position="after">
|
|
9
12
|
<group string="Fiscal Profile" name="fiscal_profile">
|
|
10
13
|
<field name="fiscal_profile_id" invisible="1" force_save="1" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-l10n_br_fiscal
|
|
3
|
-
Version: 17.0.
|
|
3
|
+
Version: 17.0.4.0.0.1
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: erpbrasil.base>=2.3.0
|
|
6
6
|
Requires-Dist: odoo-addon-l10n_br_base>=17.0dev,<17.1dev
|
|
@@ -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:d3d8d4303c70d7d8573dc89abf8f7661a3c19dde6dc541f94971847d33122362
|
|
35
35
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
36
36
|
|
|
37
37
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|