From 0a0177cb9e1af611c0d596eca97de38afa8d595c Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Sat, 15 Nov 2025 16:04:17 +0530 Subject: [PATCH 1/2] fix: construct batch_nos and serial_nos to avoid NoneType error --- erpnext/stock/stock_ledger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 47cb41852c2..f4956e1b600 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -2240,9 +2240,11 @@ def validate_reserved_stock(kwargs): kwargs.ignore_voucher_nos = [kwargs.voucher_no] if kwargs.serial_no: + kwargs.serial_nos = kwargs.serial_no.split("\n") validate_reserved_serial_nos(kwargs) elif kwargs.batch_no: + kwargs.batch_nos = [kwargs.batch_no] validate_reserved_batch_nos(kwargs) elif kwargs.serial_and_batch_bundle: From 2a5c9b469c61995a6850dee32f5572541dc87223 Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:53:55 +0530 Subject: [PATCH 2/2] fix: enable allow_negative_stock settings --- .../doctype/stock_reconciliation/test_stock_reconciliation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index afbfcdd6062..61c32d09467 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -45,6 +45,7 @@ class TestStockReconciliation(FrappeTestCase, StockTestMixin): def test_reco_for_moving_average(self): self._test_reco_sle_gle("Moving Average") + @change_settings("Stock Settings", {"allow_negative_stock": 1}) def _test_reco_sle_gle(self, valuation_method): item_code = self.make_item(properties={"valuation_method": valuation_method}).name