Skip to content

Commit

Permalink
fixup! [FIX] l10n_br_account: create with original order
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed May 14, 2024
1 parent 8bb984b commit 49c69d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ def create(self, vals_list):
# Add index to each dictionary in vals_list
indexed_vals_list = [(idx, val) for idx, val in enumerate(vals_list)]

# Reorder vals_list for processing based on the presence of
# 'fiscal_operation_line_id'
# Reorder vals_list so lines with fiscal_operation_line_id will
# be created first
sorted_indexed_vals_list = sorted(
indexed_vals_list,
key=lambda x: x[1].get("fiscal_operation_line_id") is False,
key=lambda x: not x[1].get("fiscal_operation_line_id"),
)
original_indexes = [idx for idx, _ in sorted_indexed_vals_list]
vals_list = [val for _, val in sorted_indexed_vals_list]
Expand Down

0 comments on commit 49c69d3

Please sign in to comment.