Skip to content
Merged
5 changes: 5 additions & 0 deletions l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@
move.ensure_one_doc()
return move.fiscal_document_id.action_document_correction()

def action_document_closure(self):
for move in self.filtered(lambda d: d.document_type_id):
move.ensure_one_doc()
return move.fiscal_document_id.action_document_closure()

Check warning on line 592 in l10n_br_account/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account/models/account_move.py#L591-L592

Added lines #L591 - L592 were not covered by tests

def action_document_invalidate(self):
for move in self.filtered(lambda d: d.document_type_id):
move.ensure_one_doc()
Expand Down
3 changes: 3 additions & 0 deletions l10n_br_fiscal/constants/fiscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
LOTE_PROCESSADO = ["104"]
LOTE_EM_PROCESSAMENTO = ["105"]
SERVICO_PARALIZADO = ("108", "109")
ENCERRADO = ["132", "135"]

CANCELAMENTO_HOMOLOGADO = ["101", "151"]

Expand All @@ -381,6 +382,7 @@
SITUACAO_EDOC_CANCELADA = "cancelada"
SITUACAO_EDOC_DENEGADA = "denegada"
SITUACAO_EDOC_INUTILIZADA = "inutilizada"
SITUACAO_EDOC_ENCERRADA = "encerrada"


SITUACAO_EDOC = [
Expand All @@ -392,6 +394,7 @@
(SITUACAO_EDOC_CANCELADA, "Cancelada"),
(SITUACAO_EDOC_DENEGADA, "Denegada"),
(SITUACAO_EDOC_INUTILIZADA, "Inutilizada"),
(SITUACAO_EDOC_ENCERRADA, "Encerrada"),
]
SITUACAO_EDOC_DICT = dict(SITUACAO_EDOC)

Expand Down
10 changes: 9 additions & 1 deletion l10n_br_fiscal/views/document_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<field
name="state_edoc"
widget="badge"
decoration-success="state_edoc == 'autorizada'"
decoration-success="state_edoc in ['autorizada', 'encerrada']"
decoration-info="state == 'a_enviar'"
decoration-warning="state_edoc == 'cancelada'"
decoration-danger="state_edoc == 'rejeitada'"
Expand Down Expand Up @@ -208,6 +208,14 @@
Fiscal Document: <field name="document_type_id" readonly="1" /> is <strong
>Authorized</strong>
</div>
<div
class="alert alert-success"
role="alert"
attrs="{'invisible': [('state_edoc','!=','encerrada')]}"
>
Fiscal Document: <field name="document_type_id" readonly="1" /> is <strong
>Closed</strong>
</div>
<div
class="alert alert-warning"
role="alert"
Expand Down
2 changes: 2 additions & 0 deletions l10n_br_fiscal_edi/models/document_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"12": "dist-dfe",
"13": "man",
"14": "cce",
"15": "enc-mdfe",
}


Expand Down Expand Up @@ -84,6 +85,7 @@ def _compute_display_name(self):
("12", "Distribuição DFe"),
("13", "Manifestação"),
("14", "Carta de Correção"),
("15", "Encerramento de MDFe"),
],
string="Service",
)
Expand Down
1 change: 1 addition & 0 deletions l10n_br_mdfe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .hooks import post_init_hook
from . import models
from . import report
from . import wizards
2 changes: 2 additions & 0 deletions l10n_br_mdfe/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"views/modal/modal_ferroviario.xml",
# Report
"report/damdfe_report.xml",
# Wizards
"wizards/document_closure_wizard.xml",
],
"demo": [
"demo/fiscal_document_demo.xml",
Expand Down
Loading