Merge pull request #33019 from ssiyad/fix/mutate_iter_list

fix: use `list()` on self mutating iteration
This commit is contained in:
Sagar Sharma 2022-11-18 10:25:13 +05:30 committed by GitHub
commit d1f85dd9fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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