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
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
from odoo import api, models
|
|
5
5
|
|
|
6
6
|
from ..constants.fiscal import (
|
|
7
|
-
COMMENT_TYPE_COMMERCIAL,
|
|
8
|
-
COMMENT_TYPE_FISCAL,
|
|
9
7
|
DOCUMENT_ISSUER_COMPANY,
|
|
10
8
|
)
|
|
11
9
|
|
|
@@ -75,7 +73,8 @@ class FiscalDocumentMixinMethods(models.AbstractModel):
|
|
|
75
73
|
def _get_amount_fields(self):
|
|
76
74
|
"""Get all fields with 'amount_' prefix"""
|
|
77
75
|
fields = self.env["l10n_br_fiscal.document.mixin"]._fields.keys()
|
|
78
|
-
|
|
76
|
+
prefixes = ("amount_", "fiscal_amount_")
|
|
77
|
+
amount_fields = [f for f in fields if f.startswith(prefixes)]
|
|
79
78
|
return amount_fields
|
|
80
79
|
|
|
81
80
|
@api.depends("document_serie_id", "issuer")
|
|
@@ -89,7 +88,11 @@ class FiscalDocumentMixinMethods(models.AbstractModel):
|
|
|
89
88
|
@api.depends("document_type_id", "issuer")
|
|
90
89
|
def _compute_document_serie_id(self):
|
|
91
90
|
for doc in self:
|
|
92
|
-
if
|
|
91
|
+
if (
|
|
92
|
+
not doc.document_serie_id
|
|
93
|
+
and doc.document_type_id
|
|
94
|
+
and doc.issuer == DOCUMENT_ISSUER_COMPANY
|
|
95
|
+
):
|
|
93
96
|
doc.document_serie_id = doc.document_type_id.get_document_serie(
|
|
94
97
|
doc.company_id, doc.fiscal_operation_id
|
|
95
98
|
)
|
|
@@ -159,30 +162,6 @@ class FiscalDocumentMixinMethods(models.AbstractModel):
|
|
|
159
162
|
|
|
160
163
|
doc.update(values)
|
|
161
164
|
|
|
162
|
-
def __document_comment_vals(self):
|
|
163
|
-
return {
|
|
164
|
-
"user": self.env.user,
|
|
165
|
-
"ctx": self._context,
|
|
166
|
-
"doc": self,
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
def _document_comment(self):
|
|
170
|
-
for d in self:
|
|
171
|
-
# Fiscal Comments
|
|
172
|
-
d.fiscal_additional_data = d.comment_ids.filtered(
|
|
173
|
-
lambda c: c.comment_type == COMMENT_TYPE_FISCAL
|
|
174
|
-
).compute_message(
|
|
175
|
-
d.__document_comment_vals(), d.manual_fiscal_additional_data
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
# Commercial Comments
|
|
179
|
-
d.customer_additional_data = d.comment_ids.filtered(
|
|
180
|
-
lambda c: c.comment_type == COMMENT_TYPE_COMMERCIAL
|
|
181
|
-
).compute_message(
|
|
182
|
-
d.__document_comment_vals(), d.manual_customer_additional_data
|
|
183
|
-
)
|
|
184
|
-
d.fiscal_line_ids._document_comment()
|
|
185
|
-
|
|
186
165
|
def _get_fiscal_partner(self):
|
|
187
166
|
"""
|
|
188
167
|
Hook method to determine the fiscal partner for the document.
|
|
@@ -224,152 +203,37 @@ class FiscalDocumentMixinMethods(models.AbstractModel):
|
|
|
224
203
|
elif doc.comment_ids is None:
|
|
225
204
|
doc.comment_ids = []
|
|
226
205
|
|
|
227
|
-
def
|
|
228
|
-
for record in self
|
|
229
|
-
if (
|
|
206
|
+
def _distribute_amount_to_lines(self, amount_field_name, line_field_name):
|
|
207
|
+
for record in self:
|
|
208
|
+
if not (
|
|
230
209
|
record.delivery_costs == "total"
|
|
231
210
|
or record.force_compute_delivery_costs_by_total
|
|
232
211
|
):
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
record.
|
|
243
|
-
|
|
244
|
-
- sum(
|
|
245
|
-
line.freight_value
|
|
246
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
247
|
-
)
|
|
212
|
+
continue
|
|
213
|
+
lines = record._get_product_amount_lines()
|
|
214
|
+
if not lines:
|
|
215
|
+
continue
|
|
216
|
+
amount_to_distribute = record[amount_field_name]
|
|
217
|
+
total_gross = sum(lines.mapped("price_gross"))
|
|
218
|
+
if total_gross > 0:
|
|
219
|
+
distributed_amount = 0
|
|
220
|
+
for line in lines[:-1]:
|
|
221
|
+
proportional_amount = record.currency_id.round(
|
|
222
|
+
amount_to_distribute * (line.price_gross / total_gross)
|
|
248
223
|
)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
amount_freight_value
|
|
260
|
-
- sum(
|
|
261
|
-
line.freight_value
|
|
262
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
263
|
-
)
|
|
264
|
-
)
|
|
265
|
-
for line in record._get_product_amount_lines():
|
|
266
|
-
line._onchange_fiscal_taxes()
|
|
267
|
-
record._fields["amount_total"].compute_value(record)
|
|
268
|
-
record.write(
|
|
269
|
-
{
|
|
270
|
-
name: value
|
|
271
|
-
for name, value in record._cache.items()
|
|
272
|
-
if record._fields[name].compute == "_amount_all"
|
|
273
|
-
and not record._fields[name].inverse
|
|
274
|
-
}
|
|
275
|
-
)
|
|
224
|
+
line[line_field_name] = proportional_amount
|
|
225
|
+
distributed_amount += proportional_amount
|
|
226
|
+
lines[-1][line_field_name] = amount_to_distribute - distributed_amount
|
|
227
|
+
else:
|
|
228
|
+
lines.write({line_field_name: 0.0})
|
|
229
|
+
if lines:
|
|
230
|
+
lines[0][line_field_name] = amount_to_distribute
|
|
231
|
+
|
|
232
|
+
def _inverse_amount_freight(self):
|
|
233
|
+
self._distribute_amount_to_lines("amount_freight_value", "freight_value")
|
|
276
234
|
|
|
277
235
|
def _inverse_amount_insurance(self):
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
record.delivery_costs == "total"
|
|
281
|
-
or record.force_compute_delivery_costs_by_total
|
|
282
|
-
):
|
|
283
|
-
amount_insurance_value = record.amount_insurance_value
|
|
284
|
-
if all(record._get_product_amount_lines().mapped("insurance_value")):
|
|
285
|
-
amount_insurance_old = sum(
|
|
286
|
-
record._get_product_amount_lines().mapped("insurance_value")
|
|
287
|
-
)
|
|
288
|
-
for line in record._get_product_amount_lines()[:-1]:
|
|
289
|
-
line.insurance_value = amount_insurance_value * (
|
|
290
|
-
line.insurance_value / amount_insurance_old
|
|
291
|
-
)
|
|
292
|
-
record._get_product_amount_lines()[-1].insurance_value = (
|
|
293
|
-
amount_insurance_value
|
|
294
|
-
- sum(
|
|
295
|
-
line.insurance_value
|
|
296
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
297
|
-
)
|
|
298
|
-
)
|
|
299
|
-
else:
|
|
300
|
-
amount_total = sum(
|
|
301
|
-
record._get_product_amount_lines().mapped("price_gross")
|
|
302
|
-
)
|
|
303
|
-
for line in record._get_product_amount_lines()[:-1]:
|
|
304
|
-
if line.price_gross and amount_total:
|
|
305
|
-
line.insurance_value = amount_insurance_value * (
|
|
306
|
-
line.price_gross / amount_total
|
|
307
|
-
)
|
|
308
|
-
record._get_product_amount_lines()[-1].insurance_value = (
|
|
309
|
-
amount_insurance_value
|
|
310
|
-
- sum(
|
|
311
|
-
line.insurance_value
|
|
312
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
313
|
-
)
|
|
314
|
-
)
|
|
315
|
-
for line in record._get_product_amount_lines():
|
|
316
|
-
line._onchange_fiscal_taxes()
|
|
317
|
-
record._fields["amount_total"].compute_value(record)
|
|
318
|
-
record.write(
|
|
319
|
-
{
|
|
320
|
-
name: value
|
|
321
|
-
for name, value in record._cache.items()
|
|
322
|
-
if record._fields[name].compute == "_amount_all"
|
|
323
|
-
and not record._fields[name].inverse
|
|
324
|
-
}
|
|
325
|
-
)
|
|
236
|
+
self._distribute_amount_to_lines("amount_insurance_value", "insurance_value")
|
|
326
237
|
|
|
327
238
|
def _inverse_amount_other(self):
|
|
328
|
-
|
|
329
|
-
if (
|
|
330
|
-
record.delivery_costs == "total"
|
|
331
|
-
or record.force_compute_delivery_costs_by_total
|
|
332
|
-
):
|
|
333
|
-
amount_other_value = record.amount_other_value
|
|
334
|
-
if all(record._get_product_amount_lines().mapped("other_value")):
|
|
335
|
-
amount_other_old = sum(
|
|
336
|
-
record._get_product_amount_lines().mapped("other_value")
|
|
337
|
-
)
|
|
338
|
-
for line in record._get_product_amount_lines()[:-1]:
|
|
339
|
-
line.other_value = amount_other_value * (
|
|
340
|
-
line.other_value / amount_other_old
|
|
341
|
-
)
|
|
342
|
-
record._get_product_amount_lines()[-1].other_value = (
|
|
343
|
-
amount_other_value
|
|
344
|
-
- sum(
|
|
345
|
-
line.other_value
|
|
346
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
347
|
-
)
|
|
348
|
-
)
|
|
349
|
-
else:
|
|
350
|
-
amount_total = sum(
|
|
351
|
-
record._get_product_amount_lines().mapped("price_gross")
|
|
352
|
-
)
|
|
353
|
-
for line in record._get_product_amount_lines()[:-1]:
|
|
354
|
-
if line.price_gross and amount_total:
|
|
355
|
-
line.other_value = amount_other_value * (
|
|
356
|
-
line.price_gross / amount_total
|
|
357
|
-
)
|
|
358
|
-
record._get_product_amount_lines()[-1].other_value = (
|
|
359
|
-
amount_other_value
|
|
360
|
-
- sum(
|
|
361
|
-
line.other_value
|
|
362
|
-
for line in record._get_product_amount_lines()[:-1]
|
|
363
|
-
)
|
|
364
|
-
)
|
|
365
|
-
for line in record._get_product_amount_lines():
|
|
366
|
-
line._onchange_fiscal_taxes()
|
|
367
|
-
record._fields["amount_total"].compute_value(record)
|
|
368
|
-
record.write(
|
|
369
|
-
{
|
|
370
|
-
name: value
|
|
371
|
-
for name, value in record._cache.items()
|
|
372
|
-
if record._fields[name].compute == "_amount_all"
|
|
373
|
-
and not record._fields[name].inverse
|
|
374
|
-
}
|
|
375
|
-
)
|
|
239
|
+
self._distribute_amount_to_lines("amount_other_value", "other_value")
|
|
@@ -104,7 +104,7 @@ class DocumentRelated(models.Model):
|
|
|
104
104
|
return False
|
|
105
105
|
|
|
106
106
|
self.document_type_id = related.document_type_id
|
|
107
|
-
self.document_total_amount = related.
|
|
107
|
+
self.document_total_amount = related.fiscal_amount_total
|
|
108
108
|
self.document_total_weight = related.total_weight
|
|
109
109
|
|
|
110
110
|
if related.document_type_id.electronic:
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
4
4
|
|
|
5
5
|
from odoo import _, api, fields, models
|
|
6
|
+
from odoo.exceptions import ValidationError
|
|
6
7
|
|
|
7
8
|
from ..constants.fiscal import (
|
|
8
9
|
DOCUMENT_ISSUER_COMPANY,
|
|
9
10
|
FISCAL_IN_OUT,
|
|
10
11
|
FISCAL_IN_OUT_DEFAULT,
|
|
12
|
+
SITUACAO_EDOC_EM_DIGITACAO,
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
|
|
@@ -55,6 +57,14 @@ class DocumentSerie(models.Model):
|
|
|
55
57
|
string="Invalidate Number Range",
|
|
56
58
|
)
|
|
57
59
|
|
|
60
|
+
_sql_constraints = [
|
|
61
|
+
(
|
|
62
|
+
"document_serie_unique",
|
|
63
|
+
"unique(code, document_type_id, company_id)",
|
|
64
|
+
"A Fiscal Document Serie already exists for this document type.",
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
|
|
58
68
|
@api.model
|
|
59
69
|
def _create_sequence(self, values):
|
|
60
70
|
"""Create new no_gap entry sequence for every
|
|
@@ -83,6 +93,29 @@ class DocumentSerie(models.Model):
|
|
|
83
93
|
for record in self:
|
|
84
94
|
record.display_name = record.name
|
|
85
95
|
|
|
96
|
+
def write(self, vals):
|
|
97
|
+
if "internal_sequence_id" in vals:
|
|
98
|
+
raise ValidationError(_("You cannot change the internal sequence."))
|
|
99
|
+
if "code" in vals:
|
|
100
|
+
for serie in self:
|
|
101
|
+
if serie.code == vals["code"]:
|
|
102
|
+
continue
|
|
103
|
+
if self.env["l10n_br_fiscal.document"].search_count(
|
|
104
|
+
[
|
|
105
|
+
("document_serie_id", "=", serie.id),
|
|
106
|
+
("state_edoc", "not in", [SITUACAO_EDOC_EM_DIGITACAO]),
|
|
107
|
+
],
|
|
108
|
+
limit=1,
|
|
109
|
+
):
|
|
110
|
+
raise ValidationError(
|
|
111
|
+
_(
|
|
112
|
+
"You cannot change the code of a document "
|
|
113
|
+
"serie %(name)s that is already in use.",
|
|
114
|
+
name=serie.name,
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
return super().write(vals)
|
|
118
|
+
|
|
86
119
|
def _is_invalid_number(self, document_number):
|
|
87
120
|
self.ensure_one()
|
|
88
121
|
is_invalid_number = True
|
|
@@ -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(
|
|
@@ -2101,7 +2101,7 @@ class ICMSRegulation(models.Model):
|
|
|
2101
2101
|
company.state_id != partner.state_id
|
|
2102
2102
|
and partner.ind_ie_dest == NFE_IND_IE_DEST_9
|
|
2103
2103
|
and operation_line.fiscal_operation_type == FISCAL_OUT
|
|
2104
|
-
or operation_line.fiscal_operation_id.fiscal_type
|
|
2104
|
+
or operation_line.fiscal_operation_id.fiscal_type != "return_in"
|
|
2105
2105
|
and operation_line.fiscal_operation_type == FISCAL_IN
|
|
2106
2106
|
):
|
|
2107
2107
|
domain = self._build_map_tax_def_domain(
|
|
@@ -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):
|
|
@@ -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"] += [
|
|
@@ -83,7 +83,7 @@ class ProductTemplate(models.Model):
|
|
|
83
83
|
domain="[('internal_type', '=', 'normal')]",
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
city_taxation_code_ids = fields.Many2many(
|
|
87
87
|
comodel_name="l10n_br_fiscal.city.taxation.code", string="City Taxation Code"
|
|
88
88
|
)
|
|
89
89
|
|
|
@@ -107,6 +107,10 @@ class ResPartner(models.Model):
|
|
|
107
107
|
tracking=True,
|
|
108
108
|
)
|
|
109
109
|
|
|
110
|
+
rntrc_code = fields.Char(
|
|
111
|
+
string="RNTRC Code", size=12, unaccent=False, tracking=True
|
|
112
|
+
)
|
|
113
|
+
|
|
110
114
|
def _inverse_fiscal_profile(self):
|
|
111
115
|
for p in self:
|
|
112
116
|
p._onchange_fiscal_profile_id()
|
|
@@ -450,9 +450,13 @@ class Tax(models.Model):
|
|
|
450
450
|
and cfop.destination == CFOP_DESTINATION_EXTERNAL
|
|
451
451
|
and partner.ind_ie_dest == NFE_IND_IE_DEST_9
|
|
452
452
|
and tax_dict.get("tax_value")
|
|
453
|
-
and
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
and (
|
|
454
|
+
operation_line.fiscal_operation_type == FISCAL_OUT
|
|
455
|
+
or (
|
|
456
|
+
operation_line.fiscal_operation_type == FISCAL_IN
|
|
457
|
+
and operation_line.fiscal_operation_id.fiscal_type != "return_in"
|
|
458
|
+
)
|
|
459
|
+
)
|
|
456
460
|
):
|
|
457
461
|
icms_tax_difal, _ = company.icms_regulation_id.map_tax_def_icms_difal(
|
|
458
462
|
company, partner, product, ncm, nbm, cest, operation_line, ind_final
|
|
@@ -39,45 +39,35 @@
|
|
|
39
39
|
<field name="name">Fiscal Tax Estimate multi-company</field>
|
|
40
40
|
<field name="model_id" ref="model_l10n_br_fiscal_tax_estimate" />
|
|
41
41
|
<field eval="True" name="global" />
|
|
42
|
-
<field
|
|
43
|
-
name="domain_force"
|
|
44
|
-
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
42
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
45
43
|
</record>
|
|
46
44
|
|
|
47
|
-
<record id="
|
|
45
|
+
<record id="l10n_br_fiscal_operation_rule" model="ir.rule">
|
|
48
46
|
<field name="name">Fiscal Operation multi-company</field>
|
|
49
47
|
<field name="model_id" ref="model_l10n_br_fiscal_operation" />
|
|
50
48
|
<field eval="True" name="global" />
|
|
51
|
-
<field
|
|
52
|
-
name="domain_force"
|
|
53
|
-
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
49
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
54
50
|
</record>
|
|
55
51
|
|
|
56
52
|
<record id="l10n_br_fiscal_document_serie_rule" model="ir.rule">
|
|
57
53
|
<field name="name">Fiscal Document Serie multi-company</field>
|
|
58
54
|
<field name="model_id" ref="model_l10n_br_fiscal_document_serie" />
|
|
59
55
|
<field eval="True" name="global" />
|
|
60
|
-
<field
|
|
61
|
-
name="domain_force"
|
|
62
|
-
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
56
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
63
57
|
</record>
|
|
64
58
|
|
|
65
59
|
<record id="l10n_br_fiscal_document_rule" model="ir.rule">
|
|
66
60
|
<field name="name">Fiscal Document multi-company</field>
|
|
67
61
|
<field name="model_id" ref="model_l10n_br_fiscal_document" />
|
|
68
62
|
<field eval="True" name="global" />
|
|
69
|
-
<field
|
|
70
|
-
name="domain_force"
|
|
71
|
-
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
63
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
72
64
|
</record>
|
|
73
65
|
|
|
74
66
|
<record id="l10n_br_fiscal_document_line_rule" model="ir.rule">
|
|
75
67
|
<field name="name">Fiscal Document line multi-company</field>
|
|
76
68
|
<field name="model_id" ref="model_l10n_br_fiscal_document_line" />
|
|
77
69
|
<field eval="True" name="global" />
|
|
78
|
-
<field
|
|
79
|
-
name="domain_force"
|
|
80
|
-
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
|
|
70
|
+
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
|
81
71
|
</record>
|
|
82
72
|
|
|
83
73
|
</odoo>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"l10n_br_fiscal_operation_line_manager","Fiscal Operation Line for Manager","model_l10n_br_fiscal_operation_line","l10n_br_fiscal.group_manager",1,1,1,1
|
|
68
68
|
"l10n_br_fiscal_operation_document_type_user","Fiscal Operation Document Type for User","model_l10n_br_fiscal_operation_document_type","l10n_br_fiscal.group_user",1,0,0,0
|
|
69
69
|
"l10n_br_fiscal_operation_document_type_manager","Fiscal Operation Document Type for Manager","model_l10n_br_fiscal_operation_document_type","l10n_br_fiscal.group_manager",1,1,1,1
|
|
70
|
-
"l10n_br_fiscal_partner_profile_user","Fiscal Partner Profile for User","model_l10n_br_fiscal_partner_profile","
|
|
70
|
+
"l10n_br_fiscal_partner_profile_user","Fiscal Partner Profile for User","model_l10n_br_fiscal_partner_profile","base.group_user",1,0,0,0
|
|
71
71
|
"l10n_br_fiscal_partner_profile_manager","Fiscal Partner Profile for Manager","model_l10n_br_fiscal_partner_profile","l10n_br_fiscal.group_manager",1,1,1,1
|
|
72
72
|
"l10n_br_fiscal_document_user","Fiscal Document for User","model_l10n_br_fiscal_document","l10n_br_fiscal.group_user",1,1,1,0
|
|
73
73
|
"l10n_br_fiscal_document_manager","Fiscal Document for Manager","model_l10n_br_fiscal_document","l10n_br_fiscal.group_manager",1,1,1,1
|
|
@@ -94,6 +94,5 @@
|
|
|
94
94
|
"l10n_br_fiscal_invalidate_number_manager","manager_l10n_br_fiscal_invalidate_number","model_l10n_br_fiscal_invalidate_number","l10n_br_fiscal.group_manager",1,1,1,1
|
|
95
95
|
"l10n_br_fiscal_city_taxation_code_user","Fiscal City Taxation Code for User","model_l10n_br_fiscal_city_taxation_code","l10n_br_fiscal.group_user",1,1,1,0
|
|
96
96
|
"l10n_br_fiscal_city_taxation_code_manager","Fiscal City Taxation Code for Manager","model_l10n_br_fiscal_city_taxation_code","l10n_br_fiscal.group_user",1,1,1,1
|
|
97
|
-
"l10n_br_fiscal_base_wizard_mixin_user",l10n_br_fiscal_base_wizard_mixin,model_l10n_br_fiscal_base_wizard_mixin,base.group_user,1,1,1,1
|
|
98
97
|
"l10n_br_fiscal_document_status_wizard_user",l10n_br_fiscal_document_status_wizard,model_l10n_br_fiscal_document_status_wizard,base.group_user,1,1,1,1
|
|
99
98
|
"l10n_br_fiscal_document_import_wizard_mixin_user",l10n_br_fiscal_document_import_wizard_mixin_user,model_l10n_br_fiscal_document_import_wizard_mixin,base.group_user,1,1,1,1
|
|
@@ -372,7 +372,7 @@ 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:d3d8d4303c70d7d8573dc89abf8f7661a3c19dde6dc541f94971847d33122362
|
|
376
376
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
377
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
378
|
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/l10n-brazil/17.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" /></p>
|