From e53eaee2976a104f84faa77db500f5aa2e4fddf7 Mon Sep 17 00:00:00 2001 From: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com> Date: Wed, 20 May 2026 11:37:26 +0530 Subject: [PATCH] fix(stock): remove recalculate current qty function (#54774) (cherry picked from commit b9e08f3ce40f546a31157d10590bbb51986979da) # Conflicts: # erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py --- .../stock/doctype/stock_reconciliation/stock_reconciliation.py | 3 +++ .../doctype/stock_reconciliation/test_stock_reconciliation.py | 2 +- erpnext/stock/stock_ledger.py | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index dfbbdc9254e..6e6ff13bcb0 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -1035,6 +1035,7 @@ class StockReconciliation(StockController): else: self._cancel() +<<<<<<< HEAD def recalculate_current_qty(self, voucher_detail_no, sle_creation, add_new_sle=False): from erpnext.stock.stock_ledger import get_valuation_rate @@ -1115,6 +1116,8 @@ class StockReconciliation(StockController): self.add_missing_stock_ledger_entry(row, voucher_detail_no, sle_creation) +======= +>>>>>>> b9e08f3ce4 (fix(stock): remove recalculate current qty function (#54774)) def add_missing_stock_ledger_entry(self, row, voucher_detail_no, sle_creation): if row.current_qty == 0: return diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index d720ff260ae..795ea870cf1 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -1039,7 +1039,7 @@ class TestStockReconciliation(FrappeTestCase, StockTestMixin): sr.reload() self.assertTrue(sr.items[0].serial_and_batch_bundle) - self.assertTrue(sr.items[0].current_serial_and_batch_bundle) + self.assertFalse(sr.items[0].current_serial_and_batch_bundle) def test_not_reconcile_all_batch(self): from erpnext.stock.doctype.batch.batch import get_batch_qty diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index ffdb97ef9a6..d3bd150873b 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1053,7 +1053,6 @@ class update_entries_after: def reset_actual_qty_for_stock_reco(self, sle): doc = frappe.get_doc("Stock Reconciliation", sle.voucher_no) - doc.recalculate_current_qty(sle.voucher_detail_no, sle.creation, sle.actual_qty > 0) if sle.actual_qty < 0: doc.reload()