From 21a972ad95228fa79925e42213381df7d6bc4364 Mon Sep 17 00:00:00 2001 From: venkat102 Date: Fri, 10 Oct 2025 18:47:15 +0530 Subject: [PATCH 1/2] fix(stock-reconciliation): include inventory dimensions in duplicate validation (cherry picked from commit 4b21c2cc4631bd63074f2a0f796160577a7d92d9) --- .../doctype/stock_reconciliation/stock_reconciliation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index bd0a0beceef..9140599e7ba 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -589,6 +589,10 @@ class StockReconciliation(StockController): if row.get(field): key.append(row.get(field)) + for dimension in get_inventory_dimensions(): + if row.get(dimension.get("fieldname")): + key.append(row.get(dimension.get("fieldname"))) + if key in item_warehouse_combinations: self.validation_messages.append( _get_msg(row_num, _("Same item and warehouse combination already entered.")) From 9854dedc06e96085866e74f728a4fd733c6c253d Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 14 Oct 2025 12:01:46 +0530 Subject: [PATCH 2/2] fix: duplicate serial nos (cherry picked from commit c95465cba13f05d3ee95f8693fe5650a361c427c) --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 ca3e7ec1ad7..977a41f0369 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 @@ -294,7 +294,7 @@ class SerialandBatchBundle(Document): } ) - if self.returned_against and self.docstatus == 1: + if (self.returned_against or self.voucher_type == "Stock Reconciliation") and self.docstatus == 1: kwargs["ignore_voucher_detail_no"] = self.voucher_detail_no if self.docstatus == 1: @@ -2677,7 +2677,10 @@ def get_stock_ledgers_for_serial_nos(kwargs): else: query = query.where(stock_ledger_entry[field] == kwargs.get(field)) - if kwargs.voucher_no: + if kwargs.ignore_voucher_detail_no: + query = query.where(stock_ledger_entry.voucher_detail_no != kwargs.ignore_voucher_detail_no) + + elif kwargs.voucher_no: query = query.where(stock_ledger_entry.voucher_no != kwargs.voucher_no) return query.run(as_dict=True)