Skip to content

Commit

Permalink
[REF] l10n_br_account: adapt to l10n_br_fiscal_edi
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Aug 30, 2024
1 parent 6452b22 commit f258009
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f258009

Please sign in to comment.