odoo-addon-l10n-br-fiscal 16.0.12.3.0__py3-none-any.whl → 17.0.1.0.0.13__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 +10 -10
- odoo/addons/l10n_br_fiscal/__init__.py +2 -3
- odoo/addons/l10n_br_fiscal/__manifest__.py +2 -2
- odoo/addons/l10n_br_fiscal/data/product_data.xml +2 -2
- odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +24 -420
- odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +1017 -1167
- odoo/addons/l10n_br_fiscal/models/comment.py +20 -18
- odoo/addons/l10n_br_fiscal/models/data_abstract.py +11 -12
- odoo/addons/l10n_br_fiscal/models/document.py +2 -4
- odoo/addons/l10n_br_fiscal/models/document_serie.py +4 -2
- odoo/addons/l10n_br_fiscal/models/invalidate_number.py +0 -6
- odoo/addons/l10n_br_fiscal/models/operation.py +0 -11
- odoo/addons/l10n_br_fiscal/models/tax_definition.py +2 -35
- odoo/addons/l10n_br_fiscal/static/description/index.html +8 -8
- odoo/addons/l10n_br_fiscal/tests/test_cnae.py +2 -3
- odoo/addons/l10n_br_fiscal/tests/test_document_edition.py +9 -31
- odoo/addons/l10n_br_fiscal/tests/test_service_type.py +2 -3
- odoo/addons/l10n_br_fiscal/views/cest_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/cnae_view.xml +0 -1
- odoo/addons/l10n_br_fiscal/views/document_line_mixin_view.xml +170 -140
- odoo/addons/l10n_br_fiscal/views/document_line_view.xml +7 -7
- odoo/addons/l10n_br_fiscal/views/document_related_view.xml +15 -11
- odoo/addons/l10n_br_fiscal/views/document_serie_view.xml +1 -1
- odoo/addons/l10n_br_fiscal/views/document_view.xml +30 -25
- odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +12 -12
- odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/nbm_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/nbs_view.xml +1 -1
- odoo/addons/l10n_br_fiscal/views/ncm_view.xml +3 -3
- odoo/addons/l10n_br_fiscal/views/operation_dashboard_view.xml +27 -18
- odoo/addons/l10n_br_fiscal/views/operation_line_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/operation_view.xml +39 -16
- odoo/addons/l10n_br_fiscal/views/partner_profile_view.xml +3 -6
- odoo/addons/l10n_br_fiscal/views/product_genre_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/product_product_view.xml +13 -16
- odoo/addons/l10n_br_fiscal/views/product_template_view.xml +12 -9
- odoo/addons/l10n_br_fiscal/views/res_company_view.xml +17 -12
- odoo/addons/l10n_br_fiscal/views/res_config_settings_view.xml +37 -98
- odoo/addons/l10n_br_fiscal/views/res_partner_view.xml +3 -3
- odoo/addons/l10n_br_fiscal/views/service_type_view.xml +2 -3
- odoo/addons/l10n_br_fiscal/views/tax_definition_view.xml +60 -29
- odoo/addons/l10n_br_fiscal/views/tax_estimate_view.xml +2 -2
- odoo/addons/l10n_br_fiscal/views/tax_group_view.xml +4 -4
- odoo/addons/l10n_br_fiscal/views/tax_view.xml +14 -16
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +1 -1
- odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.xml +2 -5
- {odoo_addon_l10n_br_fiscal-16.0.12.3.0.dist-info → odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info}/METADATA +15 -15
- {odoo_addon_l10n_br_fiscal-16.0.12.3.0.dist-info → odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info}/RECORD +50 -55
- odoo/addons/l10n_br_fiscal/migrations/16.0.2.0.0/pre-migration.py +0 -25
- odoo/addons/l10n_br_fiscal/migrations/16.0.2.15.0/pre-migration.py +0 -19
- odoo/addons/l10n_br_fiscal/migrations/16.0.4.0.0/pre-migration.py +0 -220
- odoo/addons/l10n_br_fiscal/migrations/16.0.5.0.0/pre-migration.py +0 -33
- odoo/addons/l10n_br_fiscal/migrations/16.0.5.2.0/pre-migration.py +0 -21
- {odoo_addon_l10n_br_fiscal-16.0.12.3.0.dist-info → odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info}/WHEEL +0 -0
- {odoo_addon_l10n_br_fiscal-16.0.12.3.0.dist-info → odoo_addon_l10n_br_fiscal-17.0.1.0.0.13.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ from datetime import datetime
|
|
|
7
7
|
from dateutil.relativedelta import relativedelta
|
|
8
8
|
|
|
9
9
|
from odoo import api, fields, models, tools
|
|
10
|
-
from odoo.osv
|
|
10
|
+
from odoo.osv import expression
|
|
11
11
|
|
|
12
12
|
from ..constants.fiscal import (
|
|
13
13
|
COMMENT_TYPE,
|
|
@@ -62,37 +62,39 @@ class Comment(models.Model):
|
|
|
62
62
|
)
|
|
63
63
|
|
|
64
64
|
@api.model
|
|
65
|
-
def _name_search(
|
|
66
|
-
self, name, args=None, operator="ilike", limit=100, name_get_uid=None
|
|
67
|
-
):
|
|
68
|
-
args = args or []
|
|
65
|
+
def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None):
|
|
69
66
|
if name:
|
|
70
|
-
domain =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
domain = expression.AND(
|
|
68
|
+
[
|
|
69
|
+
domain or [],
|
|
70
|
+
[
|
|
71
|
+
"|",
|
|
72
|
+
("comment", "ilike", "%" + name + "%"),
|
|
73
|
+
("name", operator, name),
|
|
74
|
+
],
|
|
75
|
+
]
|
|
76
|
+
)
|
|
77
|
+
return super()._search(
|
|
78
|
+
domain,
|
|
78
79
|
limit=limit,
|
|
79
|
-
name_get_uid=name_get_uid,
|
|
80
80
|
)
|
|
81
81
|
return super()._name_search(
|
|
82
82
|
name=name,
|
|
83
|
-
|
|
83
|
+
domain=domain,
|
|
84
84
|
operator=operator,
|
|
85
85
|
limit=limit,
|
|
86
|
-
|
|
86
|
+
order=order,
|
|
87
87
|
)
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
@api.depends("comment")
|
|
90
|
+
def _compute_display_name(self):
|
|
90
91
|
def truncate_name(name):
|
|
91
92
|
if len(name) > 60:
|
|
92
93
|
name = f"{name[:60]}..."
|
|
93
94
|
return name
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
for record in self:
|
|
97
|
+
record.display_name = truncate_name(record.comment)
|
|
96
98
|
|
|
97
99
|
# format_amount function for fiscal observation
|
|
98
100
|
# This way we can format numbers in currency template on fiscal observation
|
|
@@ -89,15 +89,13 @@ class DataAbstract(models.AbstractModel):
|
|
|
89
89
|
return model_view
|
|
90
90
|
|
|
91
91
|
@api.model
|
|
92
|
-
def _name_search(
|
|
93
|
-
self, name, args=None, operator="ilike", limit=100, name_get_uid=None
|
|
94
|
-
):
|
|
92
|
+
def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None):
|
|
95
93
|
if operator == "ilike" and not (name or "").strip():
|
|
96
94
|
domain = []
|
|
97
95
|
elif operator in ("ilike", "like", "=", "=like", "=ilike"):
|
|
98
96
|
domain = expression.AND(
|
|
99
97
|
[
|
|
100
|
-
|
|
98
|
+
domain or [],
|
|
101
99
|
[
|
|
102
100
|
"|",
|
|
103
101
|
"|",
|
|
@@ -108,22 +106,23 @@ class DataAbstract(models.AbstractModel):
|
|
|
108
106
|
]
|
|
109
107
|
)
|
|
110
108
|
return self._search(
|
|
111
|
-
|
|
109
|
+
domain,
|
|
112
110
|
limit=limit,
|
|
113
|
-
access_rights_uid=name_get_uid,
|
|
114
111
|
)
|
|
115
112
|
|
|
116
113
|
return super()._name_search(
|
|
117
|
-
name,
|
|
114
|
+
name, domain=domain, operator=operator, limit=limit, order=order
|
|
118
115
|
)
|
|
119
116
|
|
|
120
|
-
|
|
117
|
+
@api.depends("name", "code")
|
|
118
|
+
def _compute_display_name(self):
|
|
121
119
|
def truncate_name(name):
|
|
122
120
|
if len(name) > 60:
|
|
123
121
|
name = f"{name[:60]}..."
|
|
124
122
|
return name
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
for record in self:
|
|
125
|
+
if self._context.get("show_code_only"):
|
|
126
|
+
record.display_name = record.code
|
|
127
|
+
else:
|
|
128
|
+
record.display_name = f"{record.code} - {truncate_name(record.name)}"
|
|
@@ -361,11 +361,9 @@ class Document(models.Model):
|
|
|
361
361
|
)
|
|
362
362
|
return name
|
|
363
363
|
|
|
364
|
-
def
|
|
365
|
-
res = []
|
|
364
|
+
def _compute_display_name(self):
|
|
366
365
|
for record in self:
|
|
367
|
-
|
|
368
|
-
return res
|
|
366
|
+
record.display_name = record._compute_document_name()
|
|
369
367
|
|
|
370
368
|
@api.depends(
|
|
371
369
|
"issuer",
|
|
@@ -78,8 +78,10 @@ class DocumentSerie(models.Model):
|
|
|
78
78
|
vals.update({"internal_sequence_id": self._create_sequence(vals)})
|
|
79
79
|
return super().create(vals_list)
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
@api.depends("name")
|
|
82
|
+
def _compute_display_name(self):
|
|
83
|
+
for record in self:
|
|
84
|
+
record.display_name = record.name
|
|
83
85
|
|
|
84
86
|
def _is_invalid_number(self, document_number):
|
|
85
87
|
self.ensure_one()
|
|
@@ -28,14 +28,12 @@ class InvalidateNumber(models.Model):
|
|
|
28
28
|
readonly=True,
|
|
29
29
|
default=lambda self: self.env.company.id,
|
|
30
30
|
required=True,
|
|
31
|
-
states={"draft": [("readonly", False)]},
|
|
32
31
|
)
|
|
33
32
|
|
|
34
33
|
document_type_id = fields.Many2one(
|
|
35
34
|
comodel_name="l10n_br_fiscal.document.type",
|
|
36
35
|
required=True,
|
|
37
36
|
readonly=True,
|
|
38
|
-
states={"draft": [("readonly", False)]},
|
|
39
37
|
)
|
|
40
38
|
|
|
41
39
|
document_electronic = fields.Boolean(
|
|
@@ -49,27 +47,23 @@ class InvalidateNumber(models.Model):
|
|
|
49
47
|
('company_id', '=', company_id)]""",
|
|
50
48
|
required=True,
|
|
51
49
|
readonly=True,
|
|
52
|
-
states={"draft": [("readonly", False)]},
|
|
53
50
|
)
|
|
54
51
|
|
|
55
52
|
number_start = fields.Integer(
|
|
56
53
|
string="Initial Number",
|
|
57
54
|
required=True,
|
|
58
55
|
readonly=True,
|
|
59
|
-
states={"draft": [("readonly", False)]},
|
|
60
56
|
)
|
|
61
57
|
|
|
62
58
|
number_end = fields.Integer(
|
|
63
59
|
string="End Number",
|
|
64
60
|
required=True,
|
|
65
61
|
readonly=True,
|
|
66
|
-
states={"draft": [("readonly", False)]},
|
|
67
62
|
)
|
|
68
63
|
|
|
69
64
|
justification = fields.Char(
|
|
70
65
|
required=True,
|
|
71
66
|
readonly=True,
|
|
72
|
-
states={"draft": [("readonly", False)]},
|
|
73
67
|
)
|
|
74
68
|
|
|
75
69
|
state = fields.Selection(
|
|
@@ -72,14 +72,12 @@ class Operation(models.Model):
|
|
|
72
72
|
code = fields.Char(
|
|
73
73
|
required=True,
|
|
74
74
|
readonly=True,
|
|
75
|
-
states={"draft": [("readonly", False)]},
|
|
76
75
|
tracking=True,
|
|
77
76
|
)
|
|
78
77
|
|
|
79
78
|
name = fields.Char(
|
|
80
79
|
required=True,
|
|
81
80
|
readonly=True,
|
|
82
|
-
states={"draft": [("readonly", False)]},
|
|
83
81
|
tracking=True,
|
|
84
82
|
)
|
|
85
83
|
|
|
@@ -88,7 +86,6 @@ class Operation(models.Model):
|
|
|
88
86
|
string="Type",
|
|
89
87
|
required=True,
|
|
90
88
|
readonly=True,
|
|
91
|
-
states={"draft": [("readonly", False)]},
|
|
92
89
|
tracking=True,
|
|
93
90
|
)
|
|
94
91
|
|
|
@@ -97,7 +94,6 @@ class Operation(models.Model):
|
|
|
97
94
|
string="Finalidade",
|
|
98
95
|
default=EDOC_PURPOSE_NORMAL,
|
|
99
96
|
readonly=True,
|
|
100
|
-
states={"draft": [("readonly", False)]},
|
|
101
97
|
tracking=True,
|
|
102
98
|
)
|
|
103
99
|
|
|
@@ -106,7 +102,6 @@ class Operation(models.Model):
|
|
|
106
102
|
string="Default Price Unit?",
|
|
107
103
|
default="sale_price",
|
|
108
104
|
readonly=True,
|
|
109
|
-
states={"draft": [("readonly", False)]},
|
|
110
105
|
tracking=True,
|
|
111
106
|
)
|
|
112
107
|
|
|
@@ -115,7 +110,6 @@ class Operation(models.Model):
|
|
|
115
110
|
default=OPERATION_FISCAL_TYPE_DEFAULT,
|
|
116
111
|
required=True,
|
|
117
112
|
readonly=True,
|
|
118
|
-
states={"draft": [("readonly", False)]},
|
|
119
113
|
tracking=True,
|
|
120
114
|
)
|
|
121
115
|
|
|
@@ -123,7 +117,6 @@ class Operation(models.Model):
|
|
|
123
117
|
comodel_name="l10n_br_fiscal.operation",
|
|
124
118
|
string="Return Operation",
|
|
125
119
|
readonly=True,
|
|
126
|
-
states={"draft": [("readonly", False)]},
|
|
127
120
|
domain="[('fiscal_operation_type', '!=', fiscal_operation_type), "
|
|
128
121
|
"('fiscal_type', 'in', {'sale': ['sale_refund'], 'purchase': "
|
|
129
122
|
"['purchase_refund'], 'other': ['return_in', 'return_out'],"
|
|
@@ -136,7 +129,6 @@ class Operation(models.Model):
|
|
|
136
129
|
comodel_name="l10n_br_fiscal.operation",
|
|
137
130
|
string="Inverse Operation",
|
|
138
131
|
readonly=True,
|
|
139
|
-
states={"draft": [("readonly", False)]},
|
|
140
132
|
tracking=True,
|
|
141
133
|
)
|
|
142
134
|
|
|
@@ -144,7 +136,6 @@ class Operation(models.Model):
|
|
|
144
136
|
comodel_name="res.company",
|
|
145
137
|
string="Company",
|
|
146
138
|
readonly=True,
|
|
147
|
-
states={"draft": [("readonly", False)]},
|
|
148
139
|
tracking=True,
|
|
149
140
|
)
|
|
150
141
|
|
|
@@ -162,7 +153,6 @@ class Operation(models.Model):
|
|
|
162
153
|
inverse_name="fiscal_operation_id",
|
|
163
154
|
string="Operation Document Types",
|
|
164
155
|
readonly=True,
|
|
165
|
-
states={"draft": [("readonly", False)]},
|
|
166
156
|
)
|
|
167
157
|
|
|
168
158
|
line_ids = fields.One2many(
|
|
@@ -170,7 +160,6 @@ class Operation(models.Model):
|
|
|
170
160
|
inverse_name="fiscal_operation_id",
|
|
171
161
|
string="Operation Line",
|
|
172
162
|
readonly=True,
|
|
173
|
-
states={"draft": [("readonly", False)]},
|
|
174
163
|
copy=True,
|
|
175
164
|
)
|
|
176
165
|
|
|
@@ -63,28 +63,13 @@ class TaxDefinition(models.Model):
|
|
|
63
63
|
for record in self:
|
|
64
64
|
record.display_name = record._get_complete_name()
|
|
65
65
|
|
|
66
|
-
@api.depends("tax_group_id", "tax_id", "cst_code")
|
|
67
|
-
def name_get(self):
|
|
68
|
-
result = []
|
|
69
|
-
for record in self:
|
|
70
|
-
name = record._get_complete_name()
|
|
71
|
-
result.append((record.id, name))
|
|
72
|
-
return result
|
|
73
|
-
|
|
74
|
-
display_name = fields.Char(compute="_compute_display_name", store=True)
|
|
75
|
-
|
|
76
66
|
code = fields.Char(
|
|
77
67
|
size=8,
|
|
78
|
-
states={"draft": [("readonly", False)]},
|
|
79
68
|
)
|
|
80
69
|
|
|
81
|
-
name = fields.Char(
|
|
82
|
-
states={"draft": [("readonly", False)]},
|
|
83
|
-
)
|
|
70
|
+
name = fields.Char()
|
|
84
71
|
|
|
85
|
-
description = fields.Text(
|
|
86
|
-
states={"draft": [("readonly", False)]},
|
|
87
|
-
)
|
|
72
|
+
description = fields.Text()
|
|
88
73
|
|
|
89
74
|
type_in_out = fields.Selection(
|
|
90
75
|
selection=FISCAL_IN_OUT,
|
|
@@ -92,7 +77,6 @@ class TaxDefinition(models.Model):
|
|
|
92
77
|
required=True,
|
|
93
78
|
default=FISCAL_OUT,
|
|
94
79
|
readonly=True,
|
|
95
|
-
states={"draft": [("readonly", False)]},
|
|
96
80
|
)
|
|
97
81
|
|
|
98
82
|
tax_group_id = fields.Many2one(
|
|
@@ -100,19 +84,16 @@ class TaxDefinition(models.Model):
|
|
|
100
84
|
string="Tax Group",
|
|
101
85
|
required=True,
|
|
102
86
|
readonly=True,
|
|
103
|
-
states={"draft": [("readonly", False)]},
|
|
104
87
|
)
|
|
105
88
|
|
|
106
89
|
custom_tax = fields.Boolean(
|
|
107
90
|
readonly=True,
|
|
108
|
-
states={"draft": [("readonly", False)]},
|
|
109
91
|
)
|
|
110
92
|
|
|
111
93
|
tax_id = fields.Many2one(
|
|
112
94
|
comodel_name="l10n_br_fiscal.tax",
|
|
113
95
|
string="Tax",
|
|
114
96
|
readonly=True,
|
|
115
|
-
states={"draft": [("readonly", False)]},
|
|
116
97
|
domain="[('tax_group_id', '=', tax_group_id)]",
|
|
117
98
|
)
|
|
118
99
|
|
|
@@ -133,26 +114,22 @@ class TaxDefinition(models.Model):
|
|
|
133
114
|
related="tax_group_id.tax_domain",
|
|
134
115
|
store=True,
|
|
135
116
|
string="Tax Domain",
|
|
136
|
-
states={"draft": [("readonly", False)]},
|
|
137
117
|
)
|
|
138
118
|
|
|
139
119
|
is_taxed = fields.Boolean(
|
|
140
120
|
string="Taxed?",
|
|
141
121
|
readonly=True,
|
|
142
|
-
states={"draft": [("readonly", False)]},
|
|
143
122
|
)
|
|
144
123
|
|
|
145
124
|
is_debit_credit = fields.Boolean(
|
|
146
125
|
string="Debit/Credit?",
|
|
147
126
|
readonly=True,
|
|
148
|
-
states={"draft": [("readonly", False)]},
|
|
149
127
|
)
|
|
150
128
|
|
|
151
129
|
company_id = fields.Many2one(
|
|
152
130
|
comodel_name="res.company",
|
|
153
131
|
string="Company",
|
|
154
132
|
readonly=True,
|
|
155
|
-
states={"draft": [("readonly", False)]},
|
|
156
133
|
)
|
|
157
134
|
|
|
158
135
|
state_from_id = fields.Many2one(
|
|
@@ -170,19 +147,16 @@ class TaxDefinition(models.Model):
|
|
|
170
147
|
ncms = fields.Text(
|
|
171
148
|
string="NCM List",
|
|
172
149
|
readonly=True,
|
|
173
|
-
states={"draft": [("readonly", False)]},
|
|
174
150
|
)
|
|
175
151
|
|
|
176
152
|
ncm_exception = fields.Text(
|
|
177
153
|
string="NCM Exeption",
|
|
178
154
|
readonly=True,
|
|
179
|
-
states={"draft": [("readonly", False)]},
|
|
180
155
|
)
|
|
181
156
|
|
|
182
157
|
not_in_ncms = fields.Text(
|
|
183
158
|
string="Not in NCMs",
|
|
184
159
|
readonly=True,
|
|
185
|
-
states={"draft": [("readonly", False)]},
|
|
186
160
|
)
|
|
187
161
|
|
|
188
162
|
ncm_ids = fields.Many2many(
|
|
@@ -194,7 +168,6 @@ class TaxDefinition(models.Model):
|
|
|
194
168
|
cests = fields.Text(
|
|
195
169
|
string="CEST List",
|
|
196
170
|
readonly=True,
|
|
197
|
-
states={"draft": [("readonly", False)]},
|
|
198
171
|
)
|
|
199
172
|
|
|
200
173
|
cest_ids = fields.Many2many(
|
|
@@ -206,13 +179,11 @@ class TaxDefinition(models.Model):
|
|
|
206
179
|
nbms = fields.Text(
|
|
207
180
|
string="NBM List",
|
|
208
181
|
readonly=True,
|
|
209
|
-
states={"draft": [("readonly", False)]},
|
|
210
182
|
)
|
|
211
183
|
|
|
212
184
|
not_in_nbms = fields.Text(
|
|
213
185
|
string="Not in NBMs",
|
|
214
186
|
readonly=True,
|
|
215
|
-
states={"draft": [("readonly", False)]},
|
|
216
187
|
)
|
|
217
188
|
|
|
218
189
|
nbm_ids = fields.Many2many(
|
|
@@ -245,13 +216,11 @@ class TaxDefinition(models.Model):
|
|
|
245
216
|
date_start = fields.Datetime(
|
|
246
217
|
string="Start Date",
|
|
247
218
|
readonly=True,
|
|
248
|
-
states={"draft": [("readonly", False)]},
|
|
249
219
|
)
|
|
250
220
|
|
|
251
221
|
date_end = fields.Datetime(
|
|
252
222
|
string="End Date",
|
|
253
223
|
readonly=True,
|
|
254
|
-
states={"draft": [("readonly", False)]},
|
|
255
224
|
)
|
|
256
225
|
|
|
257
226
|
state = fields.Selection(
|
|
@@ -286,12 +255,10 @@ class TaxDefinition(models.Model):
|
|
|
286
255
|
is_benefit = fields.Boolean(
|
|
287
256
|
string="Benefit?",
|
|
288
257
|
readonly=True,
|
|
289
|
-
states={"draft": [("readonly", False)]},
|
|
290
258
|
)
|
|
291
259
|
|
|
292
260
|
benefit_type = fields.Selection(
|
|
293
261
|
selection=ICMS_TAX_BENEFIT_TYPE,
|
|
294
|
-
states={"draft": [("readonly", False)]},
|
|
295
262
|
)
|
|
296
263
|
|
|
297
264
|
def _get_search_domain(self, tax_definition):
|
|
@@ -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:928d7da34d029adae99b285991053fc5c3783fcbcf7c5d1734189be78590faf8
|
|
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/17.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-17-0/l10n-brazil-17-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=17.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/17.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/17.0/l10n_br_fiscal/static/img/fiscal_line.png" /></p>
|
|
517
|
+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/l10n-brazil/17.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/17.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:%2017.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/17.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>
|
|
@@ -6,8 +6,7 @@ from odoo.tests.common import TransactionCase
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class TestCNAE(TransactionCase):
|
|
9
|
-
def
|
|
10
|
-
"""Test CNAE name_get()"""
|
|
9
|
+
def test_display_name(self):
|
|
11
10
|
self.cnae = self.env["l10n_br_fiscal.cnae"].create(
|
|
12
11
|
{
|
|
13
12
|
"code": "TESTE",
|
|
@@ -16,4 +15,4 @@ class TestCNAE(TransactionCase):
|
|
|
16
15
|
"internal_type": "normal",
|
|
17
16
|
}
|
|
18
17
|
)
|
|
19
|
-
|
|
18
|
+
self.assertEqual(self.cnae.display_name, "TESTE - TESTE")
|
|
@@ -75,42 +75,20 @@ class TestDocumentEdition(TransactionCase):
|
|
|
75
75
|
line_form.fiscal_operation_line_id,
|
|
76
76
|
self.env.ref("l10n_br_fiscal.fo_venda_revenda"),
|
|
77
77
|
)
|
|
78
|
-
self.assertEqual(
|
|
79
|
-
line_form.ipi_tax_id, self.env.ref("l10n_br_fiscal.tax_ipi_nt")
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
line_form.fiscal_operation_line_id = self.env.ref(
|
|
83
|
-
"l10n_br_fiscal.fo_venda_venda"
|
|
84
|
-
)
|
|
85
|
-
self.assertEqual(
|
|
86
|
-
line_form.ipi_tax_id, self.env.ref("l10n_br_fiscal.tax_ipi_3_25")
|
|
87
|
-
)
|
|
88
78
|
|
|
89
|
-
#
|
|
90
|
-
|
|
91
|
-
self.assertEqual(line_form.icms_value, 37.17)
|
|
92
|
-
self.assertEqual(
|
|
93
|
-
line_form.ipi_tax_id, self.env.ref("l10n_br_fiscal.tax_ipi_3_25")
|
|
94
|
-
)
|
|
79
|
+
# line_form.fiscal_operation_line_id = False
|
|
80
|
+
# self.assertEqual(len(line_form.fiscal_tax_ids), 0)
|
|
95
81
|
|
|
96
82
|
doc = doc_form.save()
|
|
97
|
-
|
|
98
|
-
self.assertEqual(
|
|
99
|
-
self.assertEqual(
|
|
100
|
-
self.assertEqual(
|
|
101
|
-
self.assertEqual(
|
|
102
|
-
self.assertEqual(len(line.fiscal_tax_ids), 4)
|
|
103
|
-
|
|
104
|
-
self.assertEqual(
|
|
105
|
-
line.fiscal_operation_line_id,
|
|
106
|
-
self.env.ref("l10n_br_fiscal.fo_venda_venda"),
|
|
107
|
-
)
|
|
83
|
+
self.assertEqual(doc.fiscal_line_ids[0].price_unit, 100)
|
|
84
|
+
self.assertEqual(doc.fiscal_line_ids[0].fiscal_price, 100)
|
|
85
|
+
self.assertEqual(doc.fiscal_line_ids[0].quantity, 2)
|
|
86
|
+
self.assertEqual(doc.fiscal_line_ids[0].fiscal_quantity, 2)
|
|
87
|
+
self.assertEqual(len(doc.fiscal_line_ids[0].fiscal_tax_ids), 4)
|
|
108
88
|
self.assertEqual(
|
|
109
|
-
|
|
110
|
-
self.ref("l10n_br_fiscal.
|
|
89
|
+
doc.fiscal_line_ids[0].icms_tax_id.id,
|
|
90
|
+
self.ref("l10n_br_fiscal.tax_icms_12"),
|
|
111
91
|
)
|
|
112
|
-
self.assertEqual(line.ipi_tax_id, self.env.ref("l10n_br_fiscal.tax_ipi_3_25"))
|
|
113
|
-
self.assertEqual(line.icms_value, 37.17)
|
|
114
92
|
|
|
115
93
|
def test_product_fiscal_factor(self):
|
|
116
94
|
doc_form = Form(
|
|
@@ -6,9 +6,8 @@ from odoo.tests.common import TransactionCase
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class TestServiceType(TransactionCase):
|
|
9
|
-
def
|
|
10
|
-
"""Test Service Type name_get()"""
|
|
9
|
+
def test_display_name(self):
|
|
11
10
|
self.service_type = self.env["l10n_br_fiscal.service.type"].create(
|
|
12
11
|
{"code": "TESTE", "name": "TESTE", "internal_type": "normal"}
|
|
13
12
|
)
|
|
14
|
-
|
|
13
|
+
self.assertEqual(self.service_type.display_name, "TESTE - TESTE")
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
id="product_tmpl_button"
|
|
48
48
|
icon="fa-bars"
|
|
49
49
|
name="%(product.product_template_action_all)d"
|
|
50
|
-
context="{'search_default_cest_id':
|
|
51
|
-
|
|
50
|
+
context="{'search_default_cest_id': id}"
|
|
51
|
+
invisible="product_tmpl_qty == 0"
|
|
52
52
|
>
|
|
53
53
|
<field
|
|
54
54
|
string="Products"
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
<record id="cnae_tree" model="ir.ui.view">
|
|
23
23
|
<field name="name">l10n_br_fiscal.cnae.tree</field>
|
|
24
24
|
<field name="model">l10n_br_fiscal.cnae</field>
|
|
25
|
-
<field name="field_parent">children_ids</field>
|
|
26
25
|
<field name="arch" type="xml">
|
|
27
26
|
<tree>
|
|
28
27
|
<field name="code" />
|