From 783bb93913498d5970cfbecd487dc589df10895a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:22:48 +0530 Subject: [PATCH] fix: timeout error coming during reposting (backport #36715) (#36753) fix: timeout error coming during reposting (#36715) (cherry picked from commit 620b21fec59e40178fde96085003d419804f21e0) Co-authored-by: rohitwaghchaure --- erpnext/stock/stock_ledger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index a3f0032b8ac0..65e9cb7eaec5 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -503,7 +503,7 @@ def get_dependent_entries_to_fix(self, entries_to_fix, sle): def update_distinct_item_warehouses(self, dependant_sle): key = (dependant_sle.item_code, dependant_sle.warehouse) - val = frappe._dict({"sle": dependant_sle, "dependent_voucher_detail_nos": []}) + val = frappe._dict({"sle": dependant_sle}) if key not in self.distinct_item_warehouses: self.distinct_item_warehouses[key] = val @@ -517,6 +517,8 @@ def update_distinct_item_warehouses(self, dependant_sle): if getdate(dependant_sle.posting_date) < getdate(existing_sle_posting_date): val.sle_changed = True + dependent_voucher_detail_nos.append(dependant_sle.voucher_detail_no) + val.dependent_voucher_detail_nos = dependent_voucher_detail_nos self.distinct_item_warehouses[key] = val self.new_items_found = True elif dependant_sle.voucher_detail_no not in set(dependent_voucher_detail_nos):