From 5b4093069c2ce83ad9350bc251d40b9353b2f084 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 6 Aug 2025 02:37:49 +0000 Subject: [PATCH 01/26] chore(release): Bumped to Version 15.73.0 # [15.73.0](https://github.com/frappe/erpnext/compare/v15.72.3...v15.73.0) (2025-08-06) ### Bug Fixes * account currency validation to exclude cancelled entries ([4ce4d34](https://github.com/frappe/erpnext/commit/4ce4d345e7bbf0220add415812a84d54e30068a0)) * **accounts:** allow default bank account per company ([8cd90de](https://github.com/frappe/erpnext/commit/8cd90de70bbc9c89acba69683bee40e9cab870ad)) * add doctype fieldname in condition ([3603cdf](https://github.com/frappe/erpnext/commit/3603cdf45753118aa3ef2c87c87ad836f2ab882e)) * add missing parentheses ([78857cd](https://github.com/frappe/erpnext/commit/78857cd798d06db95972e7ce8578354532c37945)) * change modified timestamp so migrations work ([f8ea431](https://github.com/frappe/erpnext/commit/f8ea4315517072418b01561a35bbdda13d2c37f5)) * do not recalculate depreciation on sale invoice cancellation for fully depreciated asset ([db41b14](https://github.com/frappe/erpnext/commit/db41b143179e36607a459be4d2e64d71334f50e3)) * do not split round off when there is a cost center allocation ([e36e502](https://github.com/frappe/erpnext/commit/e36e5027d7ab46876d67d205d220228c3e4f4533)) * enable allow_on_submit for accounting dimensions in allowed doctypes ([e22f93f](https://github.com/frappe/erpnext/commit/e22f93f1fbf37f7e00d706ce2d909261ca3cdd69)) * failing subcontracting patch ([2f4a9f2](https://github.com/frappe/erpnext/commit/2f4a9f283dab89815661d7f8dae321797487147b)) * failing subcontracting patch (backport [#48940](https://github.com/frappe/erpnext/issues/48940)) ([#48961](https://github.com/frappe/erpnext/issues/48961)) ([5a984de](https://github.com/frappe/erpnext/commit/5a984de69765f7bd4d0c9eda88adaa719eb2137c)) * include child doctypes in allow_on_submit patch for accounting dimensions ([ad56177](https://github.com/frappe/erpnext/commit/ad561772349ed999b6407ee329726feb2ce71301)) * include child doctypes in repostable accounting types ([56dca02](https://github.com/frappe/erpnext/commit/56dca02cab854cb0569ace766ef078e564b40e83)) * include Sales Invoice in SABB validation for packed items ([d862a74](https://github.com/frappe/erpnext/commit/d862a742b0806a64deae378749cec721e6ff4461)) * multiple fixes for advance payment accounting (backport [#48341](https://github.com/frappe/erpnext/issues/48341)) ([#48896](https://github.com/frappe/erpnext/issues/48896)) ([cb0addc](https://github.com/frappe/erpnext/commit/cb0addc122341f3d8aadc72e342a8dbc103f8ec3)) * payment ledger voucher seperator row currencies ([5b0486c](https://github.com/frappe/erpnext/commit/5b0486ca2679c6c9dacecc463f55d909fffcf3d0)) * permission error on tests ([6f12029](https://github.com/frappe/erpnext/commit/6f120294775f2f3b7281e821f224c81564c520ac)) * prevent negative values in BOM fields ([#48520](https://github.com/frappe/erpnext/issues/48520), [#48662](https://github.com/frappe/erpnext/issues/48662)) (backport [#48696](https://github.com/frappe/erpnext/issues/48696)) ([#48897](https://github.com/frappe/erpnext/issues/48897)) ([5de5a8b](https://github.com/frappe/erpnext/commit/5de5a8bfd59c7e0640e10be6b9c003b3f102ebf1)) * **process statement of accounts:** make date fields mandatory ([3e8deee](https://github.com/frappe/erpnext/commit/3e8deeed07df25c281e0b864a0e5daa1cef7a141)) * provide company for outstanding record. ([dc4b236](https://github.com/frappe/erpnext/commit/dc4b236951da22bcd182fc1f1330ad33d8ba012d)) * provide missing `company` in report records that require reference to `Company:company:default_currency` ([070190d](https://github.com/frappe/erpnext/commit/070190d07bd4a461b43cd1fc39babe4a530e154d)) * remove api call to set default payments ([d9c1ef0](https://github.com/frappe/erpnext/commit/d9c1ef0926f29d381f74760ed8030636666d9645)) * server error on opportunity summary by sales stage report ([652589f](https://github.com/frappe/erpnext/commit/652589f636fe2181a0e228fca0b97588bf19ded7)) * set use_serial_batch_fields when creating PR from PO ([0207b82](https://github.com/frappe/erpnext/commit/0207b82f8277fd250ecef6d51d649a5f484f6381)) * submit depreciation schedule only for submitted asset ([9d8cb2f](https://github.com/frappe/erpnext/commit/9d8cb2f57c91b653e2d09be7f5701b061b36ca28)) * **tax withholding details:** avoid voucher duplication ([cee9f20](https://github.com/frappe/erpnext/commit/cee9f200ad254fa88c03c808926748fc5e8f7f2f)) * use checkout@v2 instead of v4 ([c9d69d9](https://github.com/frappe/erpnext/commit/c9d69d9629c67cfae33a3570bc915939cc664e50)) * Use correct Attachments folder in code list import ([dc7ac35](https://github.com/frappe/erpnext/commit/dc7ac3550eea936f82c41fb38081966142360890)) * use maintenance_status filter for indicators ([eec327c](https://github.com/frappe/erpnext/commit/eec327c02b7d6929653585e8ff5146b8159a1416)) * validate if journal entry linked to schedule is in draft ([37eaa07](https://github.com/frappe/erpnext/commit/37eaa07192f58314fef022442845af05834be499)) ### Features * add 'Manufacture' section to project dashboard and show linked Work Orders ([83e9842](https://github.com/frappe/erpnext/commit/83e9842dd3932e08d3084364aedd9a64376bda68)) * add non-negative constraint to batch size and sub operation time fields (backport [#48948](https://github.com/frappe/erpnext/issues/48948)) ([#48991](https://github.com/frappe/erpnext/issues/48991)) ([964f927](https://github.com/frappe/erpnext/commit/964f9275dcbd0728dc3669ec846af9be6a8ed4c8)) * Add non-negative constraint to completed qty fields in job card and time log (backport [#48946](https://github.com/frappe/erpnext/issues/48946)) ([#48989](https://github.com/frappe/erpnext/issues/48989)) ([84e91e0](https://github.com/frappe/erpnext/commit/84e91e0c7cc0e1c3c6cbe5f191464c3e63694a22)) * add show_amount_in_company_currency in gl report ([b964b12](https://github.com/frappe/erpnext/commit/b964b122edab1f70ec99d5a17a807b534c0187a5)) ### Performance Improvements * process auto bank reconciliation in batches ([19a8dde](https://github.com/frappe/erpnext/commit/19a8ddef866e201f02068b453f35919e16c5b334)) * process_gl_map causing performance issues in the reposting ([a96fa55](https://github.com/frappe/erpnext/commit/a96fa557041dbc6be6d0b28b9da773db2a6b2ef7)) ### Reverts * Revert "fix: set proper currency format" ([0355006](https://github.com/frappe/erpnext/commit/03550066a795d47ebecbf26823c6234e2435761d)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f69141a37ad..9cce394d187 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.72.3" +__version__ = "15.73.0" def get_default_company(user=None): From 6b38654542b1faa838bb25a043db228cd2b5b102 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 6 Aug 2025 12:23:54 +0000 Subject: [PATCH 02/26] chore(release): Bumped to Version 15.73.1 ## [15.73.1](https://github.com/frappe/erpnext/compare/v15.73.0...v15.73.1) (2025-08-06) ### Bug Fixes * fetch revaluated asset value for all the assets ([5224b66](https://github.com/frappe/erpnext/commit/5224b6677ddedc7d29a815130a258b9c39d4540f)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 9cce394d187..24bff067b1c 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.73.0" +__version__ = "15.73.1" def get_default_company(user=None): From fb126e0838d055a0d51141f6ce8582d273153ca7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 7 Aug 2025 00:50:56 +0530 Subject: [PATCH 03/26] fix: zero valuation rate for the batch (cherry picked from commit c8410cb5ca6a03f25b06688cadb491a36c755cc0) # Conflicts: # erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py --- .../sales_invoice/test_sales_invoice.py | 155 ++++++++++++++++++ erpnext/stock/serial_batch_bundle.py | 9 + 2 files changed, 164 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 70d09ab70ed..a693f314cec 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -7,8 +7,13 @@ import json import frappe from frappe import qb from frappe.model.dynamic_links import get_dynamic_link_map +<<<<<<< HEAD from frappe.tests.utils import FrappeTestCase, change_settings from frappe.utils import add_days, flt, format_date, getdate, nowdate, today +======= +from frappe.tests import IntegrationTestCase, change_settings +from frappe.utils import add_days, cint, flt, format_date, getdate, nowdate, today +>>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) import erpnext from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account @@ -4575,6 +4580,155 @@ class TestSalesInvoice(FrappeTestCase): self.assertEqual(stock_ledger_entry.qty, 2.0) self.assertEqual(stock_ledger_entry.stock_value_difference, 0.0) +<<<<<<< HEAD +======= + def test_system_generated_exchange_gain_or_loss_je_after_repost(self): + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry + from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import ( + update_repost_settings, + ) + + update_repost_settings() + + si = create_sales_invoice( + customer="_Test Customer USD", + debit_to="_Test Receivable USD - _TC", + currency="USD", + conversion_rate=80, + ) + + pe = get_payment_entry("Sales Invoice", si.name) + pe.reference_no = "10" + pe.reference_date = nowdate() + pe.paid_from_account_currency = si.currency + pe.paid_to_account_currency = "INR" + pe.source_exchange_rate = 85 + pe.target_exchange_rate = 1 + pe.paid_amount = si.outstanding_amount + pe.insert() + pe.submit() + + ral = frappe.new_doc("Repost Accounting Ledger") + ral.company = si.company + ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name}) + ral.save() + ral.submit() + + je = frappe.qb.DocType("Journal Entry") + jea = frappe.qb.DocType("Journal Entry Account") + q = ( + ( + frappe.qb.from_(je) + .join(jea) + .on(je.name == jea.parent) + .select(je.docstatus) + .where( + (je.voucher_type == "Exchange Gain Or Loss") + & (jea.reference_name == si.name) + & (jea.reference_type == "Sales Invoice") + & (je.is_system_generated == 1) + ) + ) + .limit(1) + .run() + ) + + self.assertEqual(q[0][0], 1) + + def test_non_batchwise_valuation_for_moving_average(self): + from erpnext.stock.doctype.item.test_item import make_item + + item_code = "_Test Item for Non Batchwise Valuation" + make_item_for_si( + item_code, + { + "is_stock_item": 1, + "has_batch_no": 1, + "create_new_batch": 1, + "batch_number_series": "TBATCH-TCNV.####", + "valuation_method": "Moving Average", + }, + ) + + doc = frappe.get_doc("Stock Settings") + original_value = cint(doc.do_not_use_batchwise_valuation) + + doc.db_set("do_not_use_batchwise_valuation", 1) + + se = make_stock_entry( + item_code=item_code, + qty=10, + target="_Test Warehouse - _TC", + rate=13.02, + valuation_method="Moving Average", + use_serial_batch_fields=True, + ) + + se_batch = get_batch_from_bundle(se.items[0].serial_and_batch_bundle) + + # without use serial and batch fields + si = create_sales_invoice( + item=item_code, + qty=1, + rate=120, + update_stock=1, + use_serial_batch_fields=False, + warehouse="_Test Warehouse - _TC", + ) + + si.reload() + si_batch = get_batch_from_bundle(si.items[0].serial_and_batch_bundle) + + self.assertEqual(se_batch, si_batch) + self.assertEqual(si.items[0].use_serial_batch_fields, 0) + + serial_and_batch_bundle = si.items[0].serial_and_batch_bundle + change_in_value = frappe.db.get_value( + "Stock Ledger Entry", + { + "voucher_type": "Sales Invoice", + "voucher_no": si.name, + "item_code": item_code, + "warehouse": "_Test Warehouse - _TC", + "serial_and_batch_bundle": serial_and_batch_bundle, + }, + "stock_value_difference", + ) + + self.assertEqual(change_in_value, 13.02 * -1) + + # with use serial and batch fields + si = create_sales_invoice( + item=item_code, + qty=1, + rate=120, + update_stock=1, + use_serial_batch_fields=True, + warehouse="_Test Warehouse - _TC", + ) + + si.reload() + + self.assertEqual(si.items[0].use_serial_batch_fields, 1) + + serial_and_batch_bundle = si.items[0].serial_and_batch_bundle + change_in_value = frappe.db.get_value( + "Stock Ledger Entry", + { + "voucher_type": "Sales Invoice", + "voucher_no": si.name, + "item_code": item_code, + "warehouse": "_Test Warehouse - _TC", + "serial_and_batch_bundle": serial_and_batch_bundle, + }, + "stock_value_difference", + ) + + self.assertEqual(change_in_value, 13.02 * -1) + + doc.db_set("do_not_use_batchwise_valuation", original_value) + +>>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) def make_item_for_si(item_code, properties=None): from erpnext.stock.doctype.item.test_item import make_item @@ -4690,6 +4844,7 @@ def create_sales_invoice(**args): "incoming_rate": args.incoming_rate or 0, "serial_and_batch_bundle": bundle_id, "allow_zero_valuation_rate": args.allow_zero_valuation_rate or 0, + "use_serial_batch_fields": args.use_serial_batch_fields or 0, }, ) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 3e3f2bcdf69..203340a9ff5 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -112,6 +112,7 @@ class SerialBatchBundle: "company": self.company, "is_rejected": self.is_rejected_entry(), "make_bundle_from_sle": 1, + "sle": self.sle, } ).make_serial_and_batch_bundle() @@ -1004,6 +1005,14 @@ class SerialBatchCreation: if not hasattr(self, "do_not_submit") or not self.do_not_submit: doc.flags.ignore_voucher_validation = True + if self.get("sle"): + doc.flags.ignore_validate = True + doc.save() + self.sle.db_set("serial_and_batch_bundle", doc.name, update_modified=False) + + if doc.flags.ignore_validate: + doc.flags.ignore_validate = False + doc.submit() else: doc.save() From a11d368465b779dcc2b4c155d5c75965d89bc769 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 7 Aug 2025 16:15:31 +0530 Subject: [PATCH 04/26] chore: fix conflicts --- .../sales_invoice/test_sales_invoice.py | 61 ------------------- 1 file changed, 61 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index a693f314cec..39faa24c16a 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -7,13 +7,8 @@ import json import frappe from frappe import qb from frappe.model.dynamic_links import get_dynamic_link_map -<<<<<<< HEAD from frappe.tests.utils import FrappeTestCase, change_settings -from frappe.utils import add_days, flt, format_date, getdate, nowdate, today -======= -from frappe.tests import IntegrationTestCase, change_settings from frappe.utils import add_days, cint, flt, format_date, getdate, nowdate, today ->>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) import erpnext from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account @@ -4580,61 +4575,6 @@ class TestSalesInvoice(FrappeTestCase): self.assertEqual(stock_ledger_entry.qty, 2.0) self.assertEqual(stock_ledger_entry.stock_value_difference, 0.0) -<<<<<<< HEAD -======= - def test_system_generated_exchange_gain_or_loss_je_after_repost(self): - from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry - from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import ( - update_repost_settings, - ) - - update_repost_settings() - - si = create_sales_invoice( - customer="_Test Customer USD", - debit_to="_Test Receivable USD - _TC", - currency="USD", - conversion_rate=80, - ) - - pe = get_payment_entry("Sales Invoice", si.name) - pe.reference_no = "10" - pe.reference_date = nowdate() - pe.paid_from_account_currency = si.currency - pe.paid_to_account_currency = "INR" - pe.source_exchange_rate = 85 - pe.target_exchange_rate = 1 - pe.paid_amount = si.outstanding_amount - pe.insert() - pe.submit() - - ral = frappe.new_doc("Repost Accounting Ledger") - ral.company = si.company - ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name}) - ral.save() - ral.submit() - - je = frappe.qb.DocType("Journal Entry") - jea = frappe.qb.DocType("Journal Entry Account") - q = ( - ( - frappe.qb.from_(je) - .join(jea) - .on(je.name == jea.parent) - .select(je.docstatus) - .where( - (je.voucher_type == "Exchange Gain Or Loss") - & (jea.reference_name == si.name) - & (jea.reference_type == "Sales Invoice") - & (je.is_system_generated == 1) - ) - ) - .limit(1) - .run() - ) - - self.assertEqual(q[0][0], 1) - def test_non_batchwise_valuation_for_moving_average(self): from erpnext.stock.doctype.item.test_item import make_item @@ -4728,7 +4668,6 @@ class TestSalesInvoice(FrappeTestCase): doc.db_set("do_not_use_batchwise_valuation", original_value) ->>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) def make_item_for_si(item_code, properties=None): from erpnext.stock.doctype.item.test_item import make_item From e0313bb27f89ba6879c18fc5eb1bd6ce67fcd86c Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 7 Aug 2025 11:03:27 +0000 Subject: [PATCH 05/26] chore(release): Bumped to Version 15.73.2 ## [15.73.2](https://github.com/frappe/erpnext/compare/v15.73.1...v15.73.2) (2025-08-07) ### Bug Fixes * zero valuation rate for the batch ([fb126e0](https://github.com/frappe/erpnext/commit/fb126e0838d055a0d51141f6ce8582d273153ca7)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 24bff067b1c..acc98d5cdc8 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.73.1" +__version__ = "15.73.2" def get_default_company(user=None): From d4519e5d3dc789e49093514edfc57c663ecd5ef1 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 8 Aug 2025 09:20:20 +0000 Subject: [PATCH 06/26] chore(release): Bumped to Version 15.74.0 # [15.74.0](https://github.com/frappe/erpnext/compare/v15.73.2...v15.74.0) (2025-08-08) ### Bug Fixes * add condition to fetch active accounts ([0d47eb1](https://github.com/frappe/erpnext/commit/0d47eb1fa070dd8bffe880cbf3c9bead9cd3d21c)) * added a flag on journal entry to ignore party account type validation if required ([8a3fdb4](https://github.com/frappe/erpnext/commit/8a3fdb4ec2d98e8f110663d410e8d2e567eaf124)) * dont validate account type in for employee party type ([d3dde83](https://github.com/frappe/erpnext/commit/d3dde833f717e73daf4606b418e12974f3270274)) * nonetype error on applying presentation_currency filter on financial statements and trial balance report ([24ca7bb](https://github.com/frappe/erpnext/commit/24ca7bb64ff6bfb3d9c107f7e8b38794fbd0a0e5)) * **purchase invoice:** filter only enabled account ([b060cdb](https://github.com/frappe/erpnext/commit/b060cdb4f56b80fb09adba670ee93defbd682562)) * stock reservation Delivered Qty against the batch ([849f646](https://github.com/frappe/erpnext/commit/849f646bd28dc1ebbb288132914fb96f1303e1f0)) * timeout while submitting purchase receipt ([e693ab7](https://github.com/frappe/erpnext/commit/e693ab76fac16d8890fdcaac61bb5fccac6f7129)) * zero valuation rate for the batch ([90a0873](https://github.com/frappe/erpnext/commit/90a08730448d165ba6a8f89ae5aacb686781f755)) ### Features * added chart of accounts and tax template for australian localisation ([#48208](https://github.com/frappe/erpnext/issues/48208)) ([36cb5b6](https://github.com/frappe/erpnext/commit/36cb5b65891666c231867e0b027828f5bfbe6ec4)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index acc98d5cdc8..4e3bf7dbffb 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.73.2" +__version__ = "15.74.0" def get_default_company(user=None): From ed50c3d8962690513720a76d4ec38e2a565956cd Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 12 Aug 2025 12:04:27 +0000 Subject: [PATCH 07/26] chore(release): Bumped to Version 15.75.0 # [15.75.0](https://github.com/frappe/erpnext/compare/v15.74.0...v15.75.0) (2025-08-12) ### Bug Fixes * avoid property setter for custom field ([faae734](https://github.com/frappe/erpnext/commit/faae7347971c0515044e8004e380c80fb8296a77)) * handle case where taxes is added invoice changed to non-export later ([90913c6](https://github.com/frappe/erpnext/commit/90913c66aeaf0d6de4ce18fe1e33e07d84a68f88)) * handle negative inventory check ([#48558](https://github.com/frappe/erpnext/issues/48558)) ([#48691](https://github.com/frappe/erpnext/issues/48691)) ([9da2be2](https://github.com/frappe/erpnext/commit/9da2be23252e205f25758361de5b3cc9c174b700)) * Pick List barcode scanner and manual picking issues ([38c886d](https://github.com/frappe/erpnext/commit/38c886db8b156c2bbb64d6a8a5be578f3d224488)) * **process statement of accounts:** use date instead of formatted date ([6ad3461](https://github.com/frappe/erpnext/commit/6ad3461953aa45ca44c33ec56fef7ed0c33af458)) * **regional-uae:** mark export items as zero rated ([9df6424](https://github.com/frappe/erpnext/commit/9df6424a20bd3391509e0fa33b40d26f441f76fd)) * **regional-uae:** restrict zero rated export to invoice ([62db42c](https://github.com/frappe/erpnext/commit/62db42cf2f65341be2d71e706b5ff7e5bbcaa5bb)) * **regional-uae:** split export determination ([106b83e](https://github.com/frappe/erpnext/commit/106b83e9f94c5bcd3725d957070a6aff7e3f8dc0)) * show message only if no tax is applied ([614d38d](https://github.com/frappe/erpnext/commit/614d38d0e63f3f4eee838af0faa8248187119817)) * show name of the employee in general ledger report ([0e7f778](https://github.com/frappe/erpnext/commit/0e7f778b3f50b6fdc81fadd1504087bfc3cbc540)) * simplify export determination logic ([68c6586](https://github.com/frappe/erpnext/commit/68c65866bf6e56fcdc4b55a3b49d3ae0c4feddf8)) * table render issue on pop-up edit ([52db89f](https://github.com/frappe/erpnext/commit/52db89f73fa6e663477edde2fd7e080758bc004c)) ### Features * add customer name column in gross profit report ([9cd6053](https://github.com/frappe/erpnext/commit/9cd60531d21f806d220c95668a7844ca5d865fc4)) * add item_name column to Material Request dialog in Purchase Order ([eafe33a](https://github.com/frappe/erpnext/commit/eafe33a1768f1a1d047c1fa118f747160adef089)) * add party name column in general ledger report ([680fa3b](https://github.com/frappe/erpnext/commit/680fa3b8f36789da70c6cace94c1ed49ac0c2045)) * add party name in GL entries ([3763ad4](https://github.com/frappe/erpnext/commit/3763ad451b1e0f7dbca301b703240cc2aa8bba77)) ### Performance Improvements * multiple performance fixes in `get_item_warehouse` (backport [#49118](https://github.com/frappe/erpnext/issues/49118)) ([76b0f4f](https://github.com/frappe/erpnext/commit/76b0f4fb2554e92688768c2e96fa6cc3895ebeed)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 4e3bf7dbffb..31383419625 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.74.0" +__version__ = "15.75.0" def get_default_company(user=None): From 02735e69ddfbefc0531655dab9c576ebf5d09058 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 13 Aug 2025 23:48:30 +0530 Subject: [PATCH 08/26] chore: convert message to toast notification (cherry picked from commit fc710011107f92e409665a768a4af6cc2633347b) (cherry picked from commit 7a04bf85bcc4a8d0a83f1c424f022ea3293a9697) --- erpnext/manufacturing/doctype/bom_creator/bom_creator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py index 6e778266b03..4761e82a048 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py @@ -473,7 +473,12 @@ def get_parent_row_no(doc, name): if row.name == name: return row.idx - frappe.msgprint(_("Parent Row No not found for {0}").format(name)) + if name == doc.name: + return None + + frappe.msgprint(_("Parent Row No not found for {0}").format(name), alert=True) + + return None @frappe.whitelist() From de641d7f68f94b255a870179fb98d1241c352c43 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 13 Aug 2025 23:38:51 +0530 Subject: [PATCH 09/26] fix: current qty for batch in stock reco (cherry picked from commit 817e719cc2674ad98ad53167f2ae6aeb2432f672) (cherry picked from commit 3ecb09ae523c76fccf2a69ae924fc28d3ab57b56) --- .../stock/doctype/stock_reconciliation/stock_reconciliation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index cf789d5bca2..ec54c9dc92e 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -1478,6 +1478,7 @@ def get_stock_balance_for( posting_time=posting_time, for_stock_levels=True, consider_negative_batches=True, + do_not_check_future_batches=True, ) or 0 ) From aaeb3ab06cc3666ca56ed6b7a069f6dba8966a57 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 14 Aug 2025 06:03:46 +0000 Subject: [PATCH 10/26] chore(release): Bumped to Version 15.75.1 ## [15.75.1](https://github.com/frappe/erpnext/compare/v15.75.0...v15.75.1) (2025-08-14) ### Bug Fixes * current qty for batch in stock reco ([de641d7](https://github.com/frappe/erpnext/commit/de641d7f68f94b255a870179fb98d1241c352c43)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 31383419625..b8489c1311d 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.75.0" +__version__ = "15.75.1" def get_default_company(user=None): From 36bc8fe3f0651a8cd83814739f576107b31678d7 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 19 Aug 2025 11:56:17 +0000 Subject: [PATCH 11/26] chore(release): Bumped to Version 15.76.0 # [15.76.0](https://github.com/frappe/erpnext/compare/v15.75.1...v15.76.0) (2025-08-19) ### Bug Fixes * add fieldname in accounting dimension filter ([ac4a5bf](https://github.com/frappe/erpnext/commit/ac4a5bfe6d5d08735dbf2745ca5f2ed7b138ea9d)) * add patch ([a853010](https://github.com/frappe/erpnext/commit/a8530105370a177b87b801bb5bc1e94959df981c)) * add validation for draft PR/PI in Asset ([4187e60](https://github.com/frappe/erpnext/commit/4187e60b07d5eb06d7cc7990e70ab88044c0c070)) * add value adjustment amount in asset value ([89ad9f1](https://github.com/frappe/erpnext/commit/89ad9f1bb4dd967671482c2d56e5dae68dcd45f5)) * add value adjustment amount in report for group by category filter ([089007f](https://github.com/frappe/erpnext/commit/089007f88a3d2e13f9a6660d90eb5f70bb1b0c69)) * additional cost not consider in valuation rate for Stock Entry transfer ([e4398d3](https://github.com/frappe/erpnext/commit/e4398d3761668b78a1c8ed1ed4f7ca8cee22ca49)) * apply grand total to default payment mode in Sales and POS invoices ([605f513](https://github.com/frappe/erpnext/commit/605f513ce3536a1c33c1c70e2681b8995a89f4eb)) * **asset:** prevent translation function shadowing in make_journal_entry ([1af8ab2](https://github.com/frappe/erpnext/commit/1af8ab2a3b30ec7691659a4975cc0cb84a01a40d)) * company issue in setup wizard ([cea4b50](https://github.com/frappe/erpnext/commit/cea4b50bbc29f0b5e42d4e0bd1fcb4e3529ab4d6)) * current qty for batch in stock reco ([3ecb09a](https://github.com/frappe/erpnext/commit/3ecb09ae523c76fccf2a69ae924fc28d3ab57b56)) * fetch fieldname in accounting dimension filter ([d494d8c](https://github.com/frappe/erpnext/commit/d494d8c29988cd24de87bd248fce642a33215a3e)) * formatted string for disabled filter in get_income_account ([c9f79b3](https://github.com/frappe/erpnext/commit/c9f79b3ba97c57ecbc119b42e4b07c98aacdf5ad)) * handle default accounting dimension ([e50d6c6](https://github.com/frappe/erpnext/commit/e50d6c6b62758941e00fe12f009b666c6deb6020)) * handle default dimension for all company ([0cd45a0](https://github.com/frappe/erpnext/commit/0cd45a0022440d404b7a6f9a94de804569782f13)) * handle empty loyalty point details ([dc953f7](https://github.com/frappe/erpnext/commit/dc953f70d1883c300c39e1e56765f299f9861b71)) * handle mode of payment filter (backport [#49185](https://github.com/frappe/erpnext/issues/49185)) ([#49221](https://github.com/frappe/erpnext/issues/49221)) ([b6c992f](https://github.com/frappe/erpnext/commit/b6c992ffebc6af20db9550d0cd7d830a2fa037c5)) * ignore links in Dunning patch (backport [#49201](https://github.com/frappe/erpnext/issues/49201)) ([#49204](https://github.com/frappe/erpnext/issues/49204)) ([07ff97f](https://github.com/frappe/erpnext/commit/07ff97f64705e854e377fc7b0bc94ece91b9a188)) * **pos:** include Product Bundle components in reserved qty to prevent overselling ([5ce0dc2](https://github.com/frappe/erpnext/commit/5ce0dc2a7a881fd7577c7363a22fabf4b58cf83a)), closes [#49021](https://github.com/frappe/erpnext/issues/49021) * **pos:** populate packed_items table in POS Invoice ([1f3d8e8](https://github.com/frappe/erpnext/commit/1f3d8e8d64b8e2919b18ac42804a454af4abe9c2)) * **pos:** use packed_items snapshot for bundle reservations ([cc82836](https://github.com/frappe/erpnext/commit/cc8283610943781fc8d64758be99c43903eca549)), closes [#49106](https://github.com/frappe/erpnext/issues/49106) * product bundle child item quantity should be a positive number ([f831d45](https://github.com/frappe/erpnext/commit/f831d45cc3972162a8f118b9d2f88f0be8871454)) * **quotation:** update currency on duplicate ([419f717](https://github.com/frappe/erpnext/commit/419f7175427d5466f4072ea97479a5cadb7d8394)) * remove unclear message related to availability of product bundle ([383744b](https://github.com/frappe/erpnext/commit/383744b8e40a1e3808bf37cc7df171082cc92dcc)) * sanitize column name for inventory_dimensions in get_stock_balance ([69389bb](https://github.com/frappe/erpnext/commit/69389bb355793c884aa040af376c0712e52f35dc)) * **stock:** don't override t_warehouse if no rules found ([da3d8fb](https://github.com/frappe/erpnext/commit/da3d8fbbc52ae5e92e386e971d55efa0201f5424)) * update dunning status based on credit notes (backport [#49066](https://github.com/frappe/erpnext/issues/49066)) ([#49208](https://github.com/frappe/erpnext/issues/49208)) ([9a12c73](https://github.com/frappe/erpnext/commit/9a12c73e22e9ecd440974d41eb896591e043100d)) * use query builder instead of raw SQL in get_blanket_orders ([4a0d7fd](https://github.com/frappe/erpnext/commit/4a0d7fd2055cdd094f614ba7f2e4acbaf4eef307)) * use query builder instead of raw SQL in get_loyalty_details ([a3c5b0a](https://github.com/frappe/erpnext/commit/a3c5b0a510c33130ac7b9512a72224b46c88cb9e)) * use query builder instead of raw SQL in get_material_requests_based_on_supplier ([9d0fe06](https://github.com/frappe/erpnext/commit/9d0fe060c852d38406e53916ada2b493690d78fd)) * use query builder instead of raw SQL in get_rfq_containing_supplier ([4ac386a](https://github.com/frappe/erpnext/commit/4ac386a84e3a7e646a2277be48ccb53dd60a5d38)) * use query builder instead of raw SQL in get_timesheet_detail_rate ([0a2a7fa](https://github.com/frappe/erpnext/commit/0a2a7fa6aa0219c99e404b47a54b6133840a7884)) * use query builder instead of raw SQL in unset_existing_data ([92391a6](https://github.com/frappe/erpnext/commit/92391a69cfbaeceae6443d09454bfe7256983bca)) * wrap inter-company order button labels in __() for translation ([#49178](https://github.com/frappe/erpnext/issues/49178)) ([db48635](https://github.com/frappe/erpnext/commit/db486356db1579f7c60c77b43996f3dd7e6c9101)) * wrap inter-company order button labels in __() for translation (backport [#49178](https://github.com/frappe/erpnext/issues/49178)) ([#49179](https://github.com/frappe/erpnext/issues/49179)) ([6030eb2](https://github.com/frappe/erpnext/commit/6030eb2992b35a47b9d07c1d69c45896a533f21a)) ### Features * enhance barcode scanner to support warehouse scanning (backport [#48865](https://github.com/frappe/erpnext/issues/48865)) ([#49162](https://github.com/frappe/erpnext/issues/49162)) ([ad052d7](https://github.com/frappe/erpnext/commit/ad052d72d73b027ee160c26f6f4a47e6bd4a607e)) * select child item when creating one document from another ([5f06d87](https://github.com/frappe/erpnext/commit/5f06d87f01309a09dca4dad4e473a2388b404172)) ### Reverts * Revert "fix: use checkout@v2 instead of v4" ([e849019](https://github.com/frappe/erpnext/commit/e8490196ba0da51edc19ca718099064cbf515208)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index b8489c1311d..08f4eca15a2 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.75.1" +__version__ = "15.76.0" def get_default_company(user=None): From c86e95e52422d395c8a4c76a83f5cbf3a2f86c11 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 26 Aug 2025 11:46:29 +0000 Subject: [PATCH 12/26] chore(release): Bumped to Version 15.77.0 # [15.77.0](https://github.com/frappe/erpnext/compare/v15.76.0...v15.77.0) (2025-08-26) ### Bug Fixes * **asset:** handle None in depreciation value ([f231b1e](https://github.com/frappe/erpnext/commit/f231b1e32f89573d09a4d64117bdcc802c438ed6)) * child item picker picking all items when creating PI from PR ([edaff5d](https://github.com/frappe/erpnext/commit/edaff5d6993df85b5e978a9297a6e27b00a44a35)) * correct logic for warehouse field label ([0767c2e](https://github.com/frappe/erpnext/commit/0767c2e0f67407c8028064e1b121f418bda98993)) * correct typo in monthly auto exchange rate revaluation filter ([aa35770](https://github.com/frappe/erpnext/commit/aa35770423d313a3958938740d3eda4a67ef8d1b)) * handle all searchfields in items ([db4fc85](https://github.com/frappe/erpnext/commit/db4fc8545dc2394ad67057fdade4a69923b01e01)) * handle ple for immutable ledger ([756216b](https://github.com/frappe/erpnext/commit/756216b2cb71b93d347698dbdad7dd77e6f93529)) * incorrect pending qty when creating sales invoice from sales order ([54030eb](https://github.com/frappe/erpnext/commit/54030eb72110c65b496c49ebec0cf845d2578ac7)) * match warehouse only when `last_scanned_warehouse` field exists ([fbbd5a3](https://github.com/frappe/erpnext/commit/fbbd5a3af5e27545002796644812c0835ea90ca4)) * Serial Nos popup only appears 1 time ([1968120](https://github.com/frappe/erpnext/commit/196812017ee5641d6a39bf33930fe3b2b33b5d2d)) * set valid serial no naming series format ([bec385a](https://github.com/frappe/erpnext/commit/bec385a6676c0cf5dfb2a29f48e6de9a4e4799c6)) * set value for asset owner company field ([94cd454](https://github.com/frappe/erpnext/commit/94cd4549c695c2bffb014ad2981223d08739e3ba)) * **Supplier:** add make_method for Pricing Rule ([#49282](https://github.com/frappe/erpnext/issues/49282)) ([ba840d2](https://github.com/frappe/erpnext/commit/ba840d22e540988e77b61d68e2288e6cac3af4b3)) ### Features * add make methods for Bank Account (backport [#49000](https://github.com/frappe/erpnext/issues/49000)) ([#49275](https://github.com/frappe/erpnext/issues/49275)) ([655af24](https://github.com/frappe/erpnext/commit/655af2418342a372eea6d976a139c445573a4799)) * **payment-reconciliation:** add posting date field for debit/credit note auto jv creation ([083661b](https://github.com/frappe/erpnext/commit/083661b779533e3514fb5e1ebf2693578642bfd9)) * show title in link field for Project DocType ([#49265](https://github.com/frappe/erpnext/issues/49265)) ([c52f2c7](https://github.com/frappe/erpnext/commit/c52f2c75f6eceab1b03c0f008397883181ab057c)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 08f4eca15a2..9720d19192b 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.76.0" +__version__ = "15.77.0" def get_default_company(user=None): From 2851f6e786484ac6c7b7d86f2743d53384b42301 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 2 Sep 2025 14:17:15 +0000 Subject: [PATCH 13/26] chore(release): Bumped to Version 15.78.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [15.78.0](https://github.com/frappe/erpnext/compare/v15.77.0...v15.78.0) (2025-09-02) ### Bug Fixes * :bug: fixing buying controller to include transaction controller… (backport [#49140](https://github.com/frappe/erpnext/issues/49140)) ([#49370](https://github.com/frappe/erpnext/issues/49370)) ([c06f72f](https://github.com/frappe/erpnext/commit/c06f72f9f7885be13cc173362349b381b882f2c4)) * add is_cancelled in condition ([f2c4bae](https://github.com/frappe/erpnext/commit/f2c4baeb0e1e982342099e4a2fca9a6737952575)) * add option to disable Transaction Log (backport [#49342](https://github.com/frappe/erpnext/issues/49342)) ([#49344](https://github.com/frappe/erpnext/issues/49344)) ([7926cfd](https://github.com/frappe/erpnext/commit/7926cfd8c408214c95ab63a7ad2bdf332988c539)) * **budget:** always set fiscal year before fetching company approver role ([e6a305e](https://github.com/frappe/erpnext/commit/e6a305e97219582c19a64f94bb73340f08321537)) * convert NaN to numerical ([0b3fac3](https://github.com/frappe/erpnext/commit/0b3fac3a0e9b98d0a3ac2a4cb5dedaf6864b76d1)) * **exchange rate revaluation:** add check for gain_loss ([1d28135](https://github.com/frappe/erpnext/commit/1d28135898e9ba28f9eae93b4f7ec06423324c6a)) * hide is_cumulative for apply_on is set to Transaction (backport [#49243](https://github.com/frappe/erpnext/issues/49243)) ([#49257](https://github.com/frappe/erpnext/issues/49257)) ([064ce4b](https://github.com/frappe/erpnext/commit/064ce4bf6d933d6e803d0980ce2274402a22a458)) * ignore cancelled gl and add company filter ([835b9c3](https://github.com/frappe/erpnext/commit/835b9c3378c3cc7b2418dca219455ddd7f4e2824)) * Issue with Barcode Scanning in Stock Entry ([45cdb39](https://github.com/frappe/erpnext/commit/45cdb39eddcd96fdec2e1bcb7e8dede2ba8159f3)) * **perf:** applying consistent index to fetch gl entries for financial statements ([a3605d8](https://github.com/frappe/erpnext/commit/a3605d83703ea91f177f9fcd287f7d0fdaa73f42)) * remove defunct payment gateway links from ERPNext Integrations workspace ([17f7351](https://github.com/frappe/erpnext/commit/17f7351f8534ccf14b0b02ad39657beea8403980)), closes [#49352](https://github.com/frappe/erpnext/issues/49352) * **repost item valuation:** reorder function call ([e802536](https://github.com/frappe/erpnext/commit/e8025365cdd5ac35ac090a96266f6d20f7b5d981)) * **repost item valuation:** validate voucher type in transaction ([6761a02](https://github.com/frappe/erpnext/commit/6761a023d02b2609fd4fe04d00c12d2e6cbca091)) * run config with force ([9d34eb6](https://github.com/frappe/erpnext/commit/9d34eb686c912cc65d3e82234086eb071497dc55)) * set missing due date in Purchase Invoice and POS Invoice ([#49232](https://github.com/frappe/erpnext/issues/49232)) ([6a31b7b](https://github.com/frappe/erpnext/commit/6a31b7b1182e87c1748c657589c01637f89e41f4)) * show company currency symbol ([ecb7858](https://github.com/frappe/erpnext/commit/ecb785806299524212c490b931e67f9cb9543749)) * show create purchase receipt button only when update stock is not checked ([caa1681](https://github.com/frappe/erpnext/commit/caa1681c5fc556836eca5b0d7fc6bf35e26e5317)) * source warehouse in manufacture entry and reqd prop of scrap warehouse ([7bb180e](https://github.com/frappe/erpnext/commit/7bb180e5da334d3b2abcd0032907764cb42b4288)) * source warehouse in manufacture entry and reqd prop of scrap warehouse (backport [#49320](https://github.com/frappe/erpnext/issues/49320)) ([#49337](https://github.com/frappe/erpnext/issues/49337)) ([be6f793](https://github.com/frappe/erpnext/commit/be6f79330a7484daa67a5cffa9ffe46f2201ba0b)) * validation for Recreate Stock Ledgers ([9f0d743](https://github.com/frappe/erpnext/commit/9f0d743e1b3a74a8b76ac900c7a7928d49e8f1fe)) * valuation for batch items ([b57dabd](https://github.com/frappe/erpnext/commit/b57dabd8ef0f816816fae44586c5a1ee384d31c2)) ### Features * optional fixed outgoing email for RfQ ([#49258](https://github.com/frappe/erpnext/issues/49258)) ([c875ff9](https://github.com/frappe/erpnext/commit/c875ff972f4596b1ed0c1160de51969e5544d4a6)) ### Performance Improvements * check PCV (smaller) table before checking GL Entries ([fc47fbe](https://github.com/frappe/erpnext/commit/fc47fbeaa1f02cd5ef48407c3e56506f8d3052d7)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 9720d19192b..015d3fc33fa 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.77.0" +__version__ = "15.78.0" def get_default_company(user=None): From 9c14aa2d018fce02e7d75df58bb9140003596ed6 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 4 Sep 2025 00:48:45 +0530 Subject: [PATCH 14/26] fix: non batch-wise valuation for batch item (cherry picked from commit 11b82ba00822a883193f4a8d119da572ef9b19f5) (cherry picked from commit affe09ee0bcc9ddab5f98638dadbfacaf08a1686) --- erpnext/stock/deprecated_serial_batch.py | 5 +++ .../serial_and_batch_bundle.py | 33 ++++++++++++++++++- erpnext/stock/serial_batch_bundle.py | 14 ++++---- erpnext/stock/stock_ledger.py | 9 +++++ erpnext/stock/utils.py | 1 + 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/deprecated_serial_batch.py b/erpnext/stock/deprecated_serial_batch.py index 825b1fe8d7e..19e77b3e068 100644 --- a/erpnext/stock/deprecated_serial_batch.py +++ b/erpnext/stock/deprecated_serial_batch.py @@ -1,4 +1,5 @@ import datetime +import json from collections import defaultdict import frappe @@ -197,6 +198,9 @@ class DeprecatedBatchNoValuation: @deprecated def set_balance_value_for_non_batchwise_valuation_batches(self): self.last_sle = self.get_last_sle_for_non_batch() + if self.last_sle and self.last_sle.stock_value: + self.stock_queue = json.loads(self.last_sle.stock_queue or "[]") or [] + self.set_balance_value_from_sl_entries() self.set_balance_value_from_bundle() @@ -271,6 +275,7 @@ class DeprecatedBatchNoValuation: .select( sle.stock_value, sle.qty_after_transaction, + sle.stock_queue, ) .where( (sle.item_code == self.sle.item_code) 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 a453457f919..e7d7446cea6 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 @@ -3,6 +3,7 @@ import collections import csv +import json from collections import Counter, defaultdict import frappe @@ -29,6 +30,7 @@ from erpnext.stock.serial_batch_bundle import ( get_batches_from_bundle, ) from erpnext.stock.serial_batch_bundle import get_serial_nos as get_serial_nos_from_bundle +from erpnext.stock.valuation import FIFOValuation class SerialNoExistsInFutureTransactionError(frappe.ValidationError): @@ -463,6 +465,8 @@ class SerialandBatchBundle(Document): ) def set_incoming_rate_for_outward_transaction(self, row=None, save=False, allow_negative_stock=False): + from erpnext.stock.utils import get_valuation_method + sle = self.get_sle_for_outward_transaction() if self.has_serial_no: @@ -479,13 +483,40 @@ class SerialandBatchBundle(Document): warehouse=self.warehouse, ) + stock_queue = [] + if hasattr(sn_obj, "stock_queue") and sn_obj.stock_queue: + stock_queue = parse_json(sn_obj.stock_queue) + + val_method = get_valuation_method(self.item_code) + for d in self.entries: available_qty = 0 if self.has_serial_no: d.incoming_rate = abs(sn_obj.serial_no_incoming_rate.get(d.serial_no, 0.0)) else: - d.incoming_rate = abs(flt(sn_obj.batch_avg_rate.get(d.batch_no))) + actual_qty = d.qty + if ( + stock_queue + and val_method == "FIFO" + and d.batch_no in sn_obj.non_batchwise_valuation_batches + ): + if actual_qty < 0: + stock_queue = FIFOValuation(stock_queue) + _prev_qty, prev_stock_value = stock_queue.get_total_stock_and_value() + + stock_queue.remove_stock(qty=abs(actual_qty)) + _qty, stock_value = stock_queue.get_total_stock_and_value() + + stock_value_difference = stock_value - prev_stock_value + d.incoming_rate = abs(flt(stock_value_difference) / abs(flt(actual_qty))) + stock_queue = stock_queue.state + else: + d.incoming_rate = abs(flt(sn_obj.batch_avg_rate.get(d.batch_no))) + stock_queue.append([d.qty, d.incoming_rate]) + d.stock_queue = json.dumps(stock_queue) + else: + d.incoming_rate = abs(flt(sn_obj.batch_avg_rate.get(d.batch_no))) available_qty = flt(sn_obj.available_qty.get(d.batch_no), d.precision("qty")) if self.docstatus == 1: diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 2a1fe92ae28..0cf0a940cf3 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -674,6 +674,7 @@ class BatchNoValuation(DeprecatedBatchNoValuation): for key, value in kwargs.items(): setattr(self, key, value) + self.stock_queue = [] self.batch_nos = self.get_batch_nos() self.prepare_batches() self.calculate_avg_rate() @@ -770,15 +771,12 @@ class BatchNoValuation(DeprecatedBatchNoValuation): self.non_batchwise_valuation_batches = self.batches return - if get_valuation_method(self.sle.item_code) == "FIFO": - self.batchwise_valuation_batches = self.batches - else: - batches = frappe.get_all( - "Batch", filters={"name": ("in", self.batches), "use_batchwise_valuation": 1}, fields=["name"] - ) + batches = frappe.get_all( + "Batch", filters={"name": ("in", self.batches), "use_batchwise_valuation": 1}, fields=["name"] + ) - for batch in batches: - self.batchwise_valuation_batches.append(batch.name) + for batch in batches: + self.batchwise_valuation_batches.append(batch.name) self.non_batchwise_valuation_batches = list(set(self.batches) - set(self.batchwise_valuation_batches)) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 61a19a95bd4..c2079096d62 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1030,6 +1030,15 @@ class update_entries_after: doc.set_incoming_rate(save=True, allow_negative_stock=self.allow_negative_stock) doc.calculate_qty_and_amount(save=True) + if stock_queue := frappe.get_all( + "Serial and Batch Entry", + filters={"parent": sle.serial_and_batch_bundle, "stock_queue": ("is", "set")}, + pluck="stock_queue", + order_by="idx desc", + limit=1, + ): + self.wh_data.stock_queue = json.loads(stock_queue[0]) if stock_queue else [] + self.wh_data.stock_value = round_off_if_near_zero(self.wh_data.stock_value + doc.total_amount) self.wh_data.qty_after_transaction += flt(doc.total_qty, self.flt_precision) if flt(self.wh_data.qty_after_transaction, self.flt_precision): diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 781fc81445c..58ecb24db48 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -373,6 +373,7 @@ def get_avg_purchase_rate(serial_nos): ) +@frappe.request_cache def get_valuation_method(item_code): """get valuation method from item or default""" val_method = frappe.db.get_value("Item", item_code, "valuation_method", cache=True) From 4dbcef3d676bb1ac290bccc2632fc2d837e36625 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 4 Sep 2025 07:18:03 +0530 Subject: [PATCH 15/26] chore: fix test case (cherry picked from commit ac8637d5a0a2c7312be1e368166d5b55e182f445) (cherry picked from commit 6bdf11f5c90d5842b2760bd635350d9d37f0258c) --- erpnext/stock/deprecated_serial_batch.py | 2 +- .../test_serial_and_batch_bundle.py | 105 ++++++++++-------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/erpnext/stock/deprecated_serial_batch.py b/erpnext/stock/deprecated_serial_batch.py index 19e77b3e068..d3eb178d778 100644 --- a/erpnext/stock/deprecated_serial_batch.py +++ b/erpnext/stock/deprecated_serial_batch.py @@ -198,7 +198,7 @@ class DeprecatedBatchNoValuation: @deprecated def set_balance_value_for_non_batchwise_valuation_batches(self): self.last_sle = self.get_last_sle_for_non_batch() - if self.last_sle and self.last_sle.stock_value: + if self.last_sle and self.last_sle.stock_queue: self.stock_queue = json.loads(self.last_sle.stock_queue or "[]") or [] self.set_balance_value_from_sl_entries() diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py index 5fdc3d56ebd..4ae2b3ce4b5 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py @@ -203,7 +203,10 @@ class TestSerialandBatchBundle(FrappeTestCase): batch_item_code, { "has_batch_no": 1, + "batch_number_series": "TEST-OLD-BAT-VAL-.#####", + "create_new_batch": 1, "is_stock_item": 1, + "valuation_method": "FIFO", }, ) @@ -256,57 +259,63 @@ class TestSerialandBatchBundle(FrappeTestCase): doc.submit() doc.reload() - bundle_doc = make_serial_batch_bundle( - { - "item_code": batch_item_code, - "warehouse": "_Test Warehouse - _TC", - "voucher_type": "Stock Entry", - "posting_date": today(), - "posting_time": nowtime(), - "qty": -10, - "batches": frappe._dict({batch_id: 10}), - "type_of_transaction": "Outward", - "do_not_submit": True, - } - ) - - bundle_doc.reload() - for row in bundle_doc.entries: - self.assertEqual(flt(row.stock_value_difference, 2), -1666.67) - - bundle_doc.flags.ignore_permissions = True - bundle_doc.flags.ignore_mandatory = True - bundle_doc.flags.ignore_links = True - bundle_doc.flags.ignore_validate = True - bundle_doc.submit() - - bundle_doc = make_serial_batch_bundle( - { - "item_code": batch_item_code, - "warehouse": "_Test Warehouse - _TC", - "voucher_type": "Stock Entry", - "posting_date": today(), - "posting_time": nowtime(), - "qty": -20, - "batches": frappe._dict({batch_id: 20}), - "type_of_transaction": "Outward", - "do_not_submit": True, - } - ) - - bundle_doc.reload() - for row in bundle_doc.entries: - self.assertEqual(flt(row.stock_value_difference, 2), -3333.33) - - bundle_doc.flags.ignore_permissions = True - bundle_doc.flags.ignore_mandatory = True - bundle_doc.flags.ignore_links = True - bundle_doc.flags.ignore_validate = True - bundle_doc.submit() - frappe.flags.ignore_serial_batch_bundle_validation = False frappe.flags.use_serial_and_batch_fields = False + se = make_stock_entry( + item_code=batch_item_code, + source="_Test Warehouse - _TC", + qty=10, + use_serial_batch_fields=True, + batch_no=batch_id, + ) + + sle = frappe.db.get_value( + "Stock Ledger Entry", + {"item_code": batch_item_code, "is_cancelled": 0, "voucher_no": se.name}, + ["stock_value_difference", "stock_queue"], + as_dict=True, + ) + + self.assertEqual(flt(sle.stock_value_difference), 1000.00 * -1) + self.assertEqual(json.loads(sle.stock_queue), [[20, 200]]) + + se = make_stock_entry( + item_code=batch_item_code, + target="_Test Warehouse - _TC", + qty=10, + rate=100, + use_serial_batch_fields=True, + ) + + sle = frappe.db.get_value( + "Stock Ledger Entry", + {"item_code": batch_item_code, "is_cancelled": 0, "voucher_no": se.name}, + ["stock_value_difference", "stock_queue"], + as_dict=True, + ) + + self.assertEqual(flt(sle.stock_value_difference), 1000.00) + self.assertEqual(json.loads(sle.stock_queue), [[20, 200]]) + + se = make_stock_entry( + item_code=batch_item_code, + source="_Test Warehouse - _TC", + qty=30, + use_serial_batch_fields=False, + ) + + sle = frappe.db.get_value( + "Stock Ledger Entry", + {"item_code": batch_item_code, "is_cancelled": 0, "voucher_no": se.name}, + ["stock_value_difference", "stock_queue", "stock_value"], + as_dict=True, + ) + + self.assertEqual(flt(sle.stock_value_difference), 5000.00 * -1) + self.assertFalse(json.loads(sle.stock_queue or "[]")) + self.assertEqual(flt(sle.stock_value), 0.0) + def test_old_serial_no_valuation(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt From ceb17b6b614d64ad3369dec9f24e9747176b620a Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 4 Sep 2025 14:39:10 +0000 Subject: [PATCH 16/26] chore(release): Bumped to Version 15.78.1 ## [15.78.1](https://github.com/frappe/erpnext/compare/v15.78.0...v15.78.1) (2025-09-04) ### Bug Fixes * non batch-wise valuation for batch item ([9c14aa2](https://github.com/frappe/erpnext/commit/9c14aa2d018fce02e7d75df58bb9140003596ed6)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 015d3fc33fa..555cb9a0d08 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.78.0" +__version__ = "15.78.1" def get_default_company(user=None): From 6ae8e32efa32c1c9b472e182d2255f5d133e1d3d Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 16 Sep 2025 14:43:36 +0000 Subject: [PATCH 17/26] chore(release): Bumped to Version 15.79.0 # [15.79.0](https://github.com/frappe/erpnext/compare/v15.78.1...v15.79.0) (2025-09-16) ### Bug Fixes * add Address and Contact in Add Column ([28b3856](https://github.com/frappe/erpnext/commit/28b3856bc91be91a837d17cb32a11d429f89ab27)) * batch qty calculation performance issue ([921f317](https://github.com/frappe/erpnext/commit/921f317423879f91c5cf199675f92990b0abbbbb)) * correct grammatical errors in asset movement validation messages ([97765ce](https://github.com/frappe/erpnext/commit/97765ce8bd7fc31269259db817b101d6638cad2e)) * correct typo in asset movement purpose validation ([edd3f5d](https://github.com/frappe/erpnext/commit/edd3f5da1ce9bd2ca9bd46707e94ad37348073bc)) * depreciate asset with remaining amount when depreciation amount exceeds current asset value ([845d346](https://github.com/frappe/erpnext/commit/845d3464b4feaf8d059ffd226e83a6a0bad4b058)) * do not allow backdated entries if stock reco exists in future for serial or batch ([44869f0](https://github.com/frappe/erpnext/commit/44869f02b4308f5b8befc81647658a5790d79546)) * incorrect batch qty ([ae3dd5b](https://github.com/frappe/erpnext/commit/ae3dd5b83165562d5ab8cee9284dbc5d1cd97c48)) * incorrect stock value in the report ([d302ca7](https://github.com/frappe/erpnext/commit/d302ca7ea0e7aecb0093f6075b92143f0ba6d368)) * non batch-wise valuation for batch item ([affe09e](https://github.com/frappe/erpnext/commit/affe09ee0bcc9ddab5f98638dadbfacaf08a1686)) * precision issue for valuation rate calculation ([7a8cd47](https://github.com/frappe/erpnext/commit/7a8cd47259e31ee60e2e33f4e5e3896fb211f3ab)) * remove ignore_permissions ([7280034](https://github.com/frappe/erpnext/commit/7280034abd80b3ce39c38f7a7f1b633843633453)) * renamed temporary bank account to 'Demo Bank Account' ([6ab287f](https://github.com/frappe/erpnext/commit/6ab287f19c947e6cf91a5988a24f93717206b4a5)) * SABB document status validation ([7bb9225](https://github.com/frappe/erpnext/commit/7bb92255c5209d7c758e1857a858e649735f8b52)) * **sales invoice:** fetch tax id from customer ([ee7da99](https://github.com/frappe/erpnext/commit/ee7da999a3d4294585249b91dbbdcf491dd56e82)) * set basic rate on selection of the batch ([39eeafd](https://github.com/frappe/erpnext/commit/39eeafd0d0119f74bda69674ffbbc74580321b85)) * skip 'Bank Account' creation on setup ([07241aa](https://github.com/frappe/erpnext/commit/07241aa54a4697fe026864c96529b0c36dd7b842)) * validation for document status ([0b2f53f](https://github.com/frappe/erpnext/commit/0b2f53fefef1f995132faeb74b2d3195e8caebaf)) ### Features * add permission check for custom button ([9db9dd6](https://github.com/frappe/erpnext/commit/9db9dd6f35a7b4a6b60c3b908b2112597e5f24fa)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 555cb9a0d08..bb8e7d85e07 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.78.1" +__version__ = "15.79.0" def get_default_company(user=None): From 48bd005a090eb946dca8d11b6dfdadab107e271d Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Thu, 18 Sep 2025 16:31:07 +0530 Subject: [PATCH 18/26] fix(stock): NoneType object error on stock entry (cherry picked from commit aee03417de3bb581a1363b0659e605ba1c22e7fe) (cherry picked from commit de8c4eec1b8190b9c5da6c28e2ae6ebda3233ad7) --- erpnext/stock/doctype/stock_entry/stock_entry.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 6bdfeef74a9..4ff31b66c19 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -2123,9 +2123,12 @@ class StockEntry(StockController): "Work Order", self.work_order, "allow_alternative_item" ) - skip_transfer, from_wip_warehouse = frappe.get_value( - "Work Order", self.work_order, ["skip_transfer", "from_wip_warehouse"] + skip_transfer, from_wip_warehouse = ( + frappe.get_value("Work Order", self.work_order, ["skip_transfer", "from_wip_warehouse"]) + if self.work_order + else [None, None] ) + item.from_warehouse = ( frappe.get_value( "Work Order Item", From 20d14881fee67536ad4c8a3c75374bf236aed331 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Sun, 21 Sep 2025 18:34:45 +0000 Subject: [PATCH 19/26] chore(release): Bumped to Version 15.79.1 ## [15.79.1](https://github.com/frappe/erpnext/compare/v15.79.0...v15.79.1) (2025-09-21) ### Bug Fixes * **stock:** NoneType object error on stock entry ([48bd005](https://github.com/frappe/erpnext/commit/48bd005a090eb946dca8d11b6dfdadab107e271d)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index bb8e7d85e07..f461b5f95a7 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.79.0" +__version__ = "15.79.1" def get_default_company(user=None): From 59a710433a2add346737274e5dd23011e83a4825 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 23 Sep 2025 10:56:50 +0530 Subject: [PATCH 20/26] fix: warehouse for batch validation (cherry picked from commit 381072170a3a50915c7fa9f142304e192328c031) (cherry picked from commit cb94c4b5f189e3fed9fbbe508490fa6d177a6ab7) --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 cf46867d64e..35cdae457b8 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 @@ -774,7 +774,9 @@ class SerialandBatchBundle(Document): (parent.warehouse == self.warehouse) & (parent.voucher_type == "Stock Reconciliation") ) elif batches: - future_entries = future_entries.where(child.batch_no.isin(batches)) + future_entries = future_entries.where( + (child.batch_no.isin(batches)) & (parent.warehouse == self.warehouse) + ) future_entries = future_entries.run(as_dict=True) From 91587517d95525b3df644cebe352ff63699e3876 Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Sat, 20 Sep 2025 17:42:54 +0530 Subject: [PATCH 21/26] fix: Consider non SABB batch qty in reserved batch validation (cherry picked from commit ae8b34e03c8f8a9cde4f0425cbd24d7ca685aa92) (cherry picked from commit 7ed97e47cc50511d0883343e527f7e2c8725c841) --- erpnext/stock/stock_ledger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 3030bde7ba2..85c0bf511f9 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -26,7 +26,7 @@ import erpnext from erpnext.stock.doctype.bin.bin import update_qty as update_bin_qty from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions from erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle import ( - get_available_batches, + get_auto_batch_nos, ) from erpnext.stock.doctype.stock_reservation_entry.stock_reservation_entry import ( get_sre_reserved_batch_nos_details, @@ -2213,7 +2213,7 @@ def validate_reserved_serial_nos(item_code, warehouse, serial_nos): def validate_reserved_batch_nos(item_code, warehouse, batch_nos): if reserved_batches_map := get_sre_reserved_batch_nos_details(item_code, warehouse, batch_nos): - available_batches = get_available_batches( + available_batches = get_auto_batch_nos( frappe._dict( { "item_code": item_code, From 98457a8530cad3dcc3f17cf8e7abebf6157c614c Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 23 Sep 2025 07:16:11 +0000 Subject: [PATCH 22/26] chore(release): Bumped to Version 15.79.2 ## [15.79.2](https://github.com/frappe/erpnext/compare/v15.79.1...v15.79.2) (2025-09-23) ### Bug Fixes * Consider non SABB batch qty in reserved batch validation ([9158751](https://github.com/frappe/erpnext/commit/91587517d95525b3df644cebe352ff63699e3876)) * warehouse for batch validation ([59a7104](https://github.com/frappe/erpnext/commit/59a710433a2add346737274e5dd23011e83a4825)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f461b5f95a7..e5cdfe8aebc 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.79.1" +__version__ = "15.79.2" def get_default_company(user=None): From 05d5dc53215783d31e9be2c8b4dbd7ff5cfa0766 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 23 Sep 2025 14:00:33 +0000 Subject: [PATCH 23/26] chore(release): Bumped to Version 15.80.0 # [15.80.0](https://github.com/frappe/erpnext/compare/v15.79.2...v15.80.0) (2025-09-23) ### Bug Fixes * **accounts receivable:** exclude employee transactions ([c071107](https://github.com/frappe/erpnext/commit/c071107b277b8da126c76df2055854a7e5332231)) * **accounts:** dynamic zero cutoff (backport [#48899](https://github.com/frappe/erpnext/issues/48899)) ([#49552](https://github.com/frappe/erpnext/issues/49552)) ([5ef7a78](https://github.com/frappe/erpnext/commit/5ef7a7857ccdc34a65025582a1c6ceafabadfcc5)) * add condition for name ([65ce737](https://github.com/frappe/erpnext/commit/65ce737c2dbbd5e76bb152c3070d12be1e2f9e0d)) * add option for currency field (backport [#49572](https://github.com/frappe/erpnext/issues/49572)) ([#49594](https://github.com/frappe/erpnext/issues/49594)) ([1a4ea07](https://github.com/frappe/erpnext/commit/1a4ea07b783038bb3638b23367664af0b4e8c013)) * auto commit if too many writes reached ([0310172](https://github.com/frappe/erpnext/commit/0310172338778a2a2886cc791f1a118beaf17230)) * Consider non SABB batch qty in reserved batch validation ([7ed97e4](https://github.com/frappe/erpnext/commit/7ed97e47cc50511d0883343e527f7e2c8725c841)) * incorrect current qty calculation for the batch ([bf48cf0](https://github.com/frappe/erpnext/commit/bf48cf02e5ab6262bbc52d43cb4e44850109b03d)) * **item:** avoid inheriting item defaults from identically named items ([#49571](https://github.com/frappe/erpnext/issues/49571)) ([9e58a56](https://github.com/frappe/erpnext/commit/9e58a56b5cadeac82ba5e8e7745ba61d06793e0c)) * only show filters in print view if 'Include filters' is enabled ([79d4731](https://github.com/frappe/erpnext/commit/79d4731fe7bb56ebc2fc841a0f772bae2deb97bc)) * **payment-reconciliation:** apply field precision for allocated and difference amounts (backport [#49448](https://github.com/frappe/erpnext/issues/49448)) ([#49595](https://github.com/frappe/erpnext/issues/49595)) ([fbd62e7](https://github.com/frappe/erpnext/commit/fbd62e72f9b674ec223f91bde2a936b5b08e24e3)) * project accounting dimension and gl posting date column width (backport [#49563](https://github.com/frappe/erpnext/issues/49563)) ([#49591](https://github.com/frappe/erpnext/issues/49591)) ([bce22cb](https://github.com/frappe/erpnext/commit/bce22cb27bc1eef5e8c40c863e9f82b6e58695a2)) * **purchase order:** get party type based on supplier field ([3aebbf6](https://github.com/frappe/erpnext/commit/3aebbf6e920bfd1cea73621e41476160b0e405a1)) * restore auto_commit_on_many_writes flag ([5320782](https://github.com/frappe/erpnext/commit/53207821aa17e244eb67df2fd62ce50628acd329)) * set first_response_time on status change of issue ([0d5613c](https://github.com/frappe/erpnext/commit/0d5613ca4c9f1535032b46219f9ada4a99b5ba23)) * skip receivable/payable account validation in payroll entry if party is not available (backport [#49585](https://github.com/frappe/erpnext/issues/49585)) ([#49598](https://github.com/frappe/erpnext/issues/49598)) ([697f6ef](https://github.com/frappe/erpnext/commit/697f6ef086eb99342fca566399c1254ae203e103)) * **stock:** NoneType object error on stock entry ([de8c4ee](https://github.com/frappe/erpnext/commit/de8c4eec1b8190b9c5da6c28e2ae6ebda3233ad7)) * warehouse for batch validation ([cb94c4b](https://github.com/frappe/erpnext/commit/cb94c4b5f189e3fed9fbbe508490fa6d177a6ab7)) ### Features * add filters option in print view (backport [#49631](https://github.com/frappe/erpnext/issues/49631)) ([#49700](https://github.com/frappe/erpnext/issues/49700)) ([e9b29ed](https://github.com/frappe/erpnext/commit/e9b29ed544e41480f8fc4654d3d1d9b7b95372ce)) * populate available qty in pick list locations ([bc7f884](https://github.com/frappe/erpnext/commit/bc7f884ae12dccd443ff9a409708f7c95dae4b98)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index e5cdfe8aebc..c0c76f604c3 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.79.2" +__version__ = "15.80.0" def get_default_company(user=None): From f43fac50edc9bf8e0781efc5a2858ba95fd18985 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 25 Sep 2025 15:10:57 +0530 Subject: [PATCH 24/26] perf: reposting for backdated transactions (cherry picked from commit 1b0fc0541be45eddff8bfef357eeaedaef6e53a3) (cherry picked from commit cd5a8366850a0ff3c621488c3d94277d18f01a57) --- erpnext/stock/stock_ledger.py | 39 ++++++++++++++--------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 85c0bf511f9..e9dcf3996dd 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -725,32 +725,16 @@ class update_entries_after: self.distinct_item_warehouses[key] = val self.new_items_found = True else: - # Check if the dependent voucher is reposted - # If not, then do not add it to the list - if not self.is_dependent_voucher_reposted(dependant_sle): - return - - existing_sle_posting_date = self.distinct_item_warehouses[key].get("sle", {}).get("posting_date") - - dependent_voucher_detail_nos = self.get_dependent_voucher_detail_nos(key) - if getdate(dependant_sle.posting_date) < getdate(existing_sle_posting_date): - if dependent_voucher_detail_nos and dependant_sle.voucher_detail_no in set( - dependent_voucher_detail_nos - ): - return - - val.sle_changed = True - dependent_voucher_detail_nos.append(dependant_sle.voucher_detail_no) - val.dependent_voucher_detail_nos = dependent_voucher_detail_nos + existing_sle = self.distinct_item_warehouses[key].get("sle", {}) + if getdate(existing_sle.get("posting_date")) > getdate(dependant_sle.posting_date): self.distinct_item_warehouses[key] = val self.new_items_found = True - elif dependant_sle.voucher_detail_no not in set(dependent_voucher_detail_nos): - # Future dependent voucher needs to be repost to get the correct stock value - # If dependent voucher has not reposted, then add it to the list - dependent_voucher_detail_nos.append(dependant_sle.voucher_detail_no) - self.new_items_found = True - val.dependent_voucher_detail_nos = dependent_voucher_detail_nos + elif dependant_sle.voucher_type == "Stock Entry" and is_transfer_stock_entry( + dependant_sle.voucher_no + ): + print(dependant_sle.voucher_no) self.distinct_item_warehouses[key] = val + self.new_items_found = True def is_dependent_voucher_reposted(self, dependant_sle) -> bool: # Return False if the dependent voucher is not reposted @@ -1772,6 +1756,8 @@ def get_sle_by_voucher_detail_no(voucher_detail_no, excluded_sle=None): "posting_time", "voucher_detail_no", "posting_datetime as timestamp", + "voucher_type", + "voucher_no", ], as_dict=1, ) @@ -2303,3 +2289,10 @@ def get_stock_value_difference(item_code, warehouse, posting_date, posting_time, difference_amount = query.run() return flt(difference_amount[0][0]) if difference_amount else 0 + + +@frappe.request_cache +def is_transfer_stock_entry(voucher_no): + purpose = frappe.get_cached_value("Stock Entry", voucher_no, "purpose") + + return purpose in ["Material Transfer", "Material Transfer for Manufacture", "Send to Subcontractor"] From a80e0d9d3904495f7ba036decad5544cf3cb379c Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Thu, 25 Sep 2025 18:05:21 +0530 Subject: [PATCH 25/26] fix: remove item name to avoid overriding item row name (cherry picked from commit 47055901c09cfed48caccaf0003e4f8c3e07ad1a) (cherry picked from commit d0e511fd2f119f27fab1b904ddc268e3fd4dd73c) --- erpnext/stock/doctype/pick_list/pick_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index f49a4c955cc..6ebe5320bbf 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -1446,7 +1446,7 @@ def get_pending_work_orders(doctype, txt, searchfield, start, page_length, filte @frappe.whitelist() def get_item_details(item_code, uom=None, warehouse=None, company=None): - details = frappe.db.get_value("Item", item_code, ["stock_uom", "name"], as_dict=1) + details = frappe.db.get_value("Item", item_code, "stock_uom", as_dict=1) details.uom = uom or details.stock_uom if uom: details.update(get_conversion_factor(item_code, uom)) From f54933e6571c0e6bd8c0ebbaa7eded57dbf73a4f Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 25 Sep 2025 15:14:17 +0000 Subject: [PATCH 26/26] chore(release): Bumped to Version 15.80.1 ## [15.80.1](https://github.com/frappe/erpnext/compare/v15.80.0...v15.80.1) (2025-09-25) ### Bug Fixes * remove item name to avoid overriding item row name ([a80e0d9](https://github.com/frappe/erpnext/commit/a80e0d9d3904495f7ba036decad5544cf3cb379c)) ### Performance Improvements * reposting for backdated transactions ([f43fac5](https://github.com/frappe/erpnext/commit/f43fac50edc9bf8e0781efc5a2858ba95fd18985)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index c0c76f604c3..6b2e9750ff3 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.80.0" +__version__ = "15.80.1" def get_default_company(user=None):