Skip to content

Commit

Permalink
Merge pull request #33019 from ssiyad/fix/mutate_iter_list
Browse files Browse the repository at this point in the history
fix: use `list()` on self mutating iteration
  • Loading branch information
s-aga-r authored Nov 18, 2022
2 parents cbe8fa7 + 0b5584a commit d1f85dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erpnext/erpnext_integrations/taxjar_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def check_for_nexus(doc, tax_dict):
item.tax_collectable = flt(0)
item.taxable_amount = flt(0)

for tax in doc.taxes:
for tax in list(doc.taxes):
if tax.account_head == TAX_ACCOUNT_HEAD:
doc.taxes.remove(tax)
return
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/report/stock_ledger/stock_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def get_opening_balance(filters, columns, sl_entries):
)

# check if any SLEs are actually Opening Stock Reconciliation
for sle in sl_entries:
for sle in list(sl_entries):
if (
sle.get("voucher_type") == "Stock Reconciliation"
and sle.posting_date == filters.from_date
Expand Down

0 comments on commit d1f85dd

Please sign in to comment.