From f258009fca522cf5a88c9005c9a4d8a28140f60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Thu, 29 Aug 2024 23:48:56 +0000 Subject: [PATCH] [REF] l10n_br_account: adapt to l10n_br_fiscal_edi --- l10n_br_account/models/account_move.py | 33 ++++---------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/l10n_br_account/models/account_move.py b/l10n_br_account/models/account_move.py index 356978781786..ffa72f05ac5e 100644 --- a/l10n_br_account/models/account_move.py +++ b/l10n_br_account/models/account_move.py @@ -552,34 +552,11 @@ def action_document_back2draft(self): move.button_draft() def action_post(self): - result = super().action_post() - - self.mapped("fiscal_document_id").filtered( - lambda d: d.document_type_id - )._document_confirm_to_send() - - # TODO FIXME - # Deixar a migração das funcionalidades do refund por último. - # Verificar se ainda haverá necessidade desse código. - - # for record in self.filtered(lambda i: i.refund_move_id): - # if record.state == "open": - # # Ao confirmar uma fatura/documento fiscal se é uma devolução - # # é feito conciliado com o documento de origem para abater - # # o valor devolvido pelo documento de refund - # to_reconcile_lines = self.env["account.move.line"] - # for line in record.move_id.line_ids: - # if line.account_id.id == record.account_id.id: - # to_reconcile_lines += line - # if line.reconciled: - # line.remove_move_reconcile() - # for line in record.refund_move_id.move_id.line_ids: - # if line.account_id.id == record.refund_move_id.account_id.id: - # to_reconcile_lines += line - - # to_reconcile_lines.filtered(lambda l: l.reconciled).reconcile() - - return result + for move in self.with_context(skip_post=True): + move.fiscal_document_ids.filtered( + lambda d: d.document_type_id + ).action_document_confirm() + return super().action_post() def view_xml(self): self.ensure_one_doc()