diff --git a/l10n_br_fiscal/models/document.py b/l10n_br_fiscal/models/document.py index ed282f8f864e..9f45108beddf 100644 --- a/l10n_br_fiscal/models/document.py +++ b/l10n_br_fiscal/models/document.py @@ -203,6 +203,12 @@ class Document(models.Model): string="DF-e Consult", ) + xml_error_message = fields.Text( + readonly=True, + string="XML validation errors", + copy=False, + ) + # Você não vai poder fazer isso em modelos que já tem state # TODO Porque não usar o campo state do fiscal.document??? state = fields.Selection(related="state_edoc", string="State") diff --git a/l10n_br_fiscal/models/document_workflow.py b/l10n_br_fiscal/models/document_workflow.py index 54fef68ab9f5..2c2d92118a6e 100644 --- a/l10n_br_fiscal/models/document_workflow.py +++ b/l10n_br_fiscal/models/document_workflow.py @@ -328,6 +328,7 @@ def action_document_send(self): to_send._document_send() def action_document_back2draft(self): + self.xml_error_message = False self._change_state(SITUACAO_EDOC_EM_DIGITACAO) def _document_cancel(self, justificative): diff --git a/l10n_br_fiscal/views/document_view.xml b/l10n_br_fiscal/views/document_view.xml index 5968cc054062..5cac2d25ce9e 100644 --- a/l10n_br_fiscal/views/document_view.xml +++ b/l10n_br_fiscal/views/document_view.xml @@ -153,6 +153,14 @@ statusbar_visible="em_digitacao,autorizada" /> +