From 1db8c5174949a176c6894fccd29d4576eebeb2ce Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 27 Mar 2021 19:02:07 +0530 Subject: [PATCH] fix: changed logic --- .../v13_0/item_reposting_for_incorrect_sl_and_gl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py index abde65f5cd..021bb72cae 100644 --- a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py +++ b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py @@ -20,7 +20,7 @@ def execute(): frappe.clear_cache() frappe.flags.warehouse_account_map = {} - company_wise_data = {} + company_list = [] data = frappe.db.sql(''' SELECT @@ -38,8 +38,8 @@ def execute(): total_sle = len(data) i = 0 for d in data: - if d.company not in company_wise_data: - company_wise_data[d.company] = True + if d.company not in company_list: + company_list.append(d.company) update_entries_after({ "item_code": d.item_code, @@ -60,7 +60,7 @@ def execute(): if data: for row in frappe.get_all('Company', filters= {'enable_perpetual_inventory': 1}): - if company_wise_data.get(row.name): + if row.name in company_list: update_gl_entries_after(posting_date, posting_time, company=row.name) frappe.db.auto_commit_on_many_writes = 0