Skip to content

Commit

Permalink
[RFC] l10n_br_account: refactor method to override create in account.…
Browse files Browse the repository at this point in the history
…move.line
  • Loading branch information
marcelsavegnago committed May 6, 2024
1 parent 8d648d7 commit 529c87f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,9 @@ def create(self, vals_list):
AccountMoveLine, self.with_context(create_from_move_line=True)
).create(vals_list)

# Unfortunately when creating several aml there is no way to selectively avoid
# the creation of l10n_br_fiscal.document.line as it would mess the association
# of the remaining fiscal document lines with their proper aml. That's why we
# remove the useless fiscal document lines here.
for line in results:
if not line.move_id.fiscal_document_id or line.exclude_from_invoice_tab:
fiscal_line_to_delete = line.fiscal_document_line_id
line.fiscal_document_line_id = False
fiscal_line_to_delete.sudo().unlink()

return results

Expand Down

0 comments on commit 529c87f

Please sign in to comment.