From 926b4c7065cad79ae33eb53d409a734bfc1fc74a Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 23 Dec 2025 16:42:06 +0000 Subject: [PATCH 1/5] chore(release): Bumped to Version 15.93.0 # [15.93.0](https://github.com/frappe/erpnext/compare/v15.92.5...v15.93.0) (2025-12-23) ### Bug Fixes * added limit ([73643de](https://github.com/frappe/erpnext/commit/73643de61256651e12d545dfef3587ee978f57b2)) * **buying:** add disabled filter for supplier ([0b6b73b](https://github.com/frappe/erpnext/commit/0b6b73b5004fc61b83cdc0563c41318c7b8ead7a)) * cascade projected quantity across multiple items in material requests ([dffd5d9](https://github.com/frappe/erpnext/commit/dffd5d9cdd8e2f1d30a69472687de1230575f811)) * de-duplicate rows on disassembly with multiple manufacture entries ([68eeba4](https://github.com/frappe/erpnext/commit/68eeba41c1eb3a503f5fe0acd6f1d48d320c216f)) * do not hide primary-action for composite asset ([cbcfe6e](https://github.com/frappe/erpnext/commit/cbcfe6ec36df51a8d232c67a24ce7bd36f5fb7f8)) * don't fetch qty as it's unused ([dd19b95](https://github.com/frappe/erpnext/commit/dd19b95113f1a16a33ac1e2051c0ae7fc5b8674b)) * incorrect current qty in stock reco (backport [#51152](https://github.com/frappe/erpnext/issues/51152)) ([#51158](https://github.com/frappe/erpnext/issues/51158)) ([89d6a8f](https://github.com/frappe/erpnext/commit/89d6a8f02ec7b4ec9886b4b44621da3cb7d5bf70)) * limit condition to fetch serial nos ([425dcee](https://github.com/frappe/erpnext/commit/425dcee5bfe2b8a5d18b661c518e9ec8072e8322)) * **manufacturing:** validate delivered qty in production plan ([c01f20d](https://github.com/frappe/erpnext/commit/c01f20da00bec7a29826e1eaa396acc64d87fcab)) * **payment entry:** set row id for 'On Previous Row Amount' or 'On Previous Row Total' charge type on tax table ([d7c50cf](https://github.com/frappe/erpnext/commit/d7c50cfa7c68209d87643cfcbec59cb86531c4a9)) * **pegged currencies:** skip adding currencies_to_add items on pegged_currency_item if source_currency or pegged_against currency doc does not exist (backport [#51188](https://github.com/frappe/erpnext/issues/51188)) ([#51203](https://github.com/frappe/erpnext/issues/51203)) ([8ef09c0](https://github.com/frappe/erpnext/commit/8ef09c0dc00db0f21472d7be419a866418600e16)) * same serial number was picked in multiple sales invoices ([dc5faa8](https://github.com/frappe/erpnext/commit/dc5faa8b7107e6edec59188f50c854b7013d151e)) * show company currency in asset depreciation schedule ([5b1795b](https://github.com/frappe/erpnext/commit/5b1795b0a5b180c482c7c70c331109da30f7e7aa)) * **stock-report:** ignore reserved stock in batch qty calculation ([26a36d8](https://github.com/frappe/erpnext/commit/26a36d807e3f5b3d12bf2cacf8ba15a95a0f840e)) * **stock:** handle serial and batch nos for disassemble stock entry ([59aef4f](https://github.com/frappe/erpnext/commit/59aef4fc8c95e4a085f5d55c058d9fdaa77c4959)) * **stock:** ignore reserved stock while calculating batch qty ([ac2402d](https://github.com/frappe/erpnext/commit/ac2402dd2a6ce89a54e73070c1959eaad464e510)) * support disassemble of RMs other than in BOM ([72d77a5](https://github.com/frappe/erpnext/commit/72d77a5e99699602f607471a4c4c5301434006d1)) * update batch_qty using get_batch_qty ([ca835c8](https://github.com/frappe/erpnext/commit/ca835c831b7bfd8ecec40251aab487a9c2137fcb)) * use get_batch_qty to fetch batch data ([10b0da8](https://github.com/frappe/erpnext/commit/10b0da8bc81fda31aa9fc2047478928c78fb2e2c)) * use original logic for v15 - inverted wrt v16 ([0452b22](https://github.com/frappe/erpnext/commit/0452b22aa663c89fd954b0c1590a1dc5507ddd52)) * use serial and batch bundle to fetch incoming rate (backport [#51119](https://github.com/frappe/erpnext/issues/51119)) ([#51146](https://github.com/frappe/erpnext/issues/51146)) ([2d42904](https://github.com/frappe/erpnext/commit/2d42904bfb9c98ef43d776412c7eab48a46dec51)) * use stock adjustment if the account has not set ([8a01a70](https://github.com/frappe/erpnext/commit/8a01a709a7746c3b0b4891046fdadd4cd54f7878)) ### Features * add redirect button on report ([fe80d1d](https://github.com/frappe/erpnext/commit/fe80d1d0e737b235ff5a3d0ef764de0b91d354d5)) * **report:** add batch qty update functionality in report ([57c356a](https://github.com/frappe/erpnext/commit/57c356a1cd4cca079c69bd7561d75789332315e9)) ### Performance Improvements * optimize company monthly sales query using date range ([#48942](https://github.com/frappe/erpnext/issues/48942)) ([0488658](https://github.com/frappe/erpnext/commit/048865811c1ad0ea43f3a7937970c98dd624d3ec)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 3ae42e4b52d..e163fab60a5 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from frappe.utils.user import is_website_user -__version__ = "15.92.5" +__version__ = "15.93.0" def get_default_company(user=None): From a85792385338d1abb9b055d27e0cd4f10b3c5b85 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 30 Dec 2025 13:35:04 +0000 Subject: [PATCH 2/5] chore(release): Bumped to Version 15.93.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [15.93.1](https://github.com/frappe/erpnext/compare/v15.93.0...v15.93.1) (2025-12-30) ### Bug Fixes * **accounts-payable-summary:** add Show GL Balance check similar to A… (backport [#50802](https://github.com/frappe/erpnext/issues/50802)) ([#50805](https://github.com/frappe/erpnext/issues/50805)) ([a04f560](https://github.com/frappe/erpnext/commit/a04f5600483fea35cec317b16027df930475a48b)) * **bank reconciliation tool:** carry bank account to payment entry ([cd930c0](https://github.com/frappe/erpnext/commit/cd930c05b8f27df65a2cbc0533fa7935d10406ba)) * **bank reconciliation tool:** fix incorrect bank account field mapping ([9ef0e8b](https://github.com/frappe/erpnext/commit/9ef0e8beb7c22085831fb91d60ec3c2edfdac6a7)) * expense_account query override in Purchase Receipt ([6f3904a](https://github.com/frappe/erpnext/commit/6f3904a20a4fdd117b6d8a4802d622b5e9415d8f)) * **payment entry:** clear party_name for internal transfer ([431e687](https://github.com/frappe/erpnext/commit/431e68741baded5b8d634b75cb8dc41d932d05f1)) * prevent reuse of serial no in manufacture and repack entry ([24f6f1e](https://github.com/frappe/erpnext/commit/24f6f1e434eeaad548a1ae464ded6277d5e51d1c)) * **repost accounting ledger:** prevent preview generation when no vouchers are selected ([93c1a3f](https://github.com/frappe/erpnext/commit/93c1a3f8f30a00b2ef5413b74ab653f39d080526)) * start reposting accounting ledger after commit ([e6acdf3](https://github.com/frappe/erpnext/commit/e6acdf36e2003d2110de29a4e0e5c7b0b10eb00a)) * **stock:** remove total bar in chart view ([d9888d5](https://github.com/frappe/erpnext/commit/d9888d51955e8136d0750ad7612ae06aea191467)) * updating base amounts through python for timesheet for v15 ([9d2e0f6](https://github.com/frappe/erpnext/commit/9d2e0f67d5de35b3f4413f0be6b553fda2978bc6)) * validate depreciation row values ([2f10b9c](https://github.com/frappe/erpnext/commit/2f10b9c5104367bbeaf90e6ed071d335967a8f34)) * validate party's existing transaction currency before merging ([1c40a61](https://github.com/frappe/erpnext/commit/1c40a61d236a6fe2bd4c3dc99714bb95ce7e58f1)) ### Performance Improvements * composite index for serial no ([507a561](https://github.com/frappe/erpnext/commit/507a561922bdd63273c15bd1dbdb4ea7fb1dbbf4)) * index for warehouse field ([4753594](https://github.com/frappe/erpnext/commit/4753594a26901a9d852d01d65690a4af514bfa70)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index e163fab60a5..617f2df31a7 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from frappe.utils.user import is_website_user -__version__ = "15.93.0" +__version__ = "15.93.1" def get_default_company(user=None): From 9ef7d4548611a2e43d86667f0dfd0b08f638c0a8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 3 Jan 2026 14:56:12 +0530 Subject: [PATCH 3/5] fix: not able to submit backdated stock reco (cherry picked from commit cccd34b06a28e52e6c9635e3478eecf3e6ade280) # Conflicts: # erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py (cherry picked from commit 4b6097914abfe5f602723dd83faeb1f0082f7e15) --- .../repost_item_valuation.py | 9 ++ .../serial_and_batch_bundle.py | 15 ++-- .../test_stock_reconciliation.py | 88 +++++++++++++++++++ 3 files changed, 106 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 49ba0bf8358..96660288eff 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -69,6 +69,15 @@ class RepostItemValuation(Document): ), ) +<<<<<<< HEAD +======= + def on_discard(self): + self.db_set("status", "Cancelled") + + def repost_now(self): + repost(self) + +>>>>>>> cccd34b06a (fix: not able to submit backdated stock reco) def validate(self): self.set_company() self.validate_period_closing_voucher() diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index aa22e6b8bde..ffd0a0a137d 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -554,7 +554,7 @@ class SerialandBatchBundle(Document): available_qty += flt(d.qty, precision) if not allow_negative_stock: - self.validate_negative_batch(d.batch_no, available_qty) + self.validate_negative_batch(d.batch_no, available_qty, field) d.stock_value_difference = flt(d.qty) * flt(d.incoming_rate) @@ -567,8 +567,8 @@ class SerialandBatchBundle(Document): } ) - def validate_negative_batch(self, batch_no, available_qty): - if available_qty < 0 and not self.is_stock_reco_for_valuation_adjustment(available_qty): + def validate_negative_batch(self, batch_no, available_qty, field=None): + if available_qty < 0 and not self.is_stock_reco_for_valuation_adjustment(available_qty, field=field): msg = f"""Batch No {bold(batch_no)} of an Item {bold(self.item_code)} has negative stock of quantity {bold(available_qty)} in the @@ -576,13 +576,16 @@ class SerialandBatchBundle(Document): frappe.throw(_(msg), BatchNegativeStockError) - def is_stock_reco_for_valuation_adjustment(self, available_qty): + def is_stock_reco_for_valuation_adjustment(self, available_qty, field=None): if ( self.voucher_type == "Stock Reconciliation" and self.type_of_transaction == "Outward" and self.voucher_detail_no - and abs(frappe.db.get_value("Stock Reconciliation Item", self.voucher_detail_no, "qty")) - == abs(available_qty) + and ( + abs(frappe.db.get_value("Stock Reconciliation Item", self.voucher_detail_no, "qty")) + == abs(available_qty) + or field == "total_qty" + ) ): return True diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 61c32d09467..b45934ffebd 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -1557,6 +1557,94 @@ class TestStockReconciliation(FrappeTestCase, StockTestMixin): self.assertFalse(status == "Active") + def test_change_valuation_of_batch_using_backdated_stock_reco(self): + from erpnext.stock.doctype.batch.batch import get_batch_qty + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + + item_code = self.make_item( + "Test Item Change Valuation of Batch", + { + "is_stock_item": 1, + "has_batch_no": 1, + "create_new_batch": 1, + "batch_number_series": "TEST-BATCH-CVB-.###", + }, + ).name + + warehouse = "_Test Warehouse - _TC" + + reco = create_stock_reconciliation( + item_code=item_code, + posting_date=add_days(nowdate(), -6), + warehouse=warehouse, + qty=10, + rate=80, + use_serial_batch_fields=1, + ) + + batch_no = get_batch_from_bundle(reco.items[0].serial_and_batch_bundle) + + make_stock_entry( + item_code=item_code, + source=warehouse, + qty=2, + posting_date=add_days(nowdate(), -4), + use_serial_batch_fields=1, + batch_no=batch_no, + ) + + make_stock_entry( + item_code=item_code, + source=warehouse, + qty=2, + posting_date=add_days(nowdate(), -3), + use_serial_batch_fields=1, + batch_no=batch_no, + ) + + se4 = make_stock_entry( + item_code=item_code, + source=warehouse, + qty=2, + posting_date=add_days(nowdate(), -2), + use_serial_batch_fields=1, + batch_no=batch_no, + ) + + sle = frappe.db.get_value( + "Stock Ledger Entry", + {"voucher_no": se4.name, "is_cancelled": 0}, + ["actual_qty", "stock_value_difference"], + as_dict=1, + ) + + valuation_rate = sle.stock_value_difference / sle.actual_qty + self.assertEqual(valuation_rate, 80) + + create_stock_reconciliation( + item_code=item_code, + posting_date=add_days(nowdate(), -5), + warehouse=warehouse, + qty=10, + rate=100, + use_serial_batch_fields=1, + batch_no=batch_no, + ) + + sle = frappe.db.get_value( + "Stock Ledger Entry", + {"voucher_no": se4.name, "is_cancelled": 0}, + ["actual_qty", "stock_value_difference"], + as_dict=1, + ) + + valuation_rate = sle.stock_value_difference / sle.actual_qty + + self.assertEqual(valuation_rate, 100) + + batch_qty = get_batch_qty(batch_no, warehouse, item_code) + self.assertEqual(batch_qty, 4) + def create_batch_item_with_batch(item_name, batch_id): batch_item_doc = create_item(item_name, is_stock_item=1) From 1ec2cc38206e7f7504b07eee44c1717996f6f500 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Sat, 3 Jan 2026 15:23:29 +0530 Subject: [PATCH 4/5] chore: fix conflicts Removed unused on_discard method and cleaned up code. (cherry picked from commit 46f3ab1c39be37930a2c7561eeba4ab807872c26) --- .../doctype/repost_item_valuation/repost_item_valuation.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 96660288eff..e3b1b330fad 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -69,15 +69,9 @@ class RepostItemValuation(Document): ), ) -<<<<<<< HEAD -======= - def on_discard(self): - self.db_set("status", "Cancelled") - def repost_now(self): repost(self) ->>>>>>> cccd34b06a (fix: not able to submit backdated stock reco) def validate(self): self.set_company() self.validate_period_closing_voucher() From 1740fce6c8d6896e2b01a89564b5ec06bed2cd6c Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Sat, 3 Jan 2026 10:31:34 +0000 Subject: [PATCH 5/5] chore(release): Bumped to Version 15.93.2 ## [15.93.2](https://github.com/frappe/erpnext/compare/v15.93.1...v15.93.2) (2026-01-03) ### Bug Fixes * not able to submit backdated stock reco ([9ef7d45](https://github.com/frappe/erpnext/commit/9ef7d4548611a2e43d86667f0dfd0b08f638c0a8)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 617f2df31a7..b9dfd4326d3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from frappe.utils.user import is_website_user -__version__ = "15.93.1" +__version__ = "15.93.2" def get_default_company(user=None):