From f6a1ea804a6a4d61df43f2b9b75178c4cc3b8234 Mon Sep 17 00:00:00 2001 From: Thomas antony <77287334+thomasantony12@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:48:15 +0530 Subject: [PATCH 1/2] fix: Add handling for Sales Invoice Item quantity field Add handling for Sales Invoice Item quantity field (cherry picked from commit edfcaee99b19906191e2c1c7db44ce11966f1833) --- .../doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 2 ++ 1 file changed, 2 insertions(+) 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 f1b16da4b3e..5472a8c6bc4 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 @@ -1028,6 +1028,8 @@ class SerialandBatchBundle(Document): qty_field = "consumed_qty" elif row.get("doctype") == "Stock Entry Detail": qty_field = "transfer_qty" + elif row.get("doctype") == "Sales Invoice Item": + qty_field = "stock_qty" return qty_field From 2d864bb599f44b325f2d4a00f3ea836a36f0db87 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 19 Feb 2026 04:45:20 +0530 Subject: [PATCH 2/2] fix: add purchase invoice as well (cherry picked from commit 1fc2eddf6f6d1630bbef04a36277e38f68dd4592) --- .../doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 2 +- 1 file changed, 1 insertion(+), 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 5472a8c6bc4..b8350af3bc2 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 @@ -1028,7 +1028,7 @@ class SerialandBatchBundle(Document): qty_field = "consumed_qty" elif row.get("doctype") == "Stock Entry Detail": qty_field = "transfer_qty" - elif row.get("doctype") == "Sales Invoice Item": + elif row.get("doctype") in ["Sales Invoice Item", "Purchase Invoice Item"]: qty_field = "stock_qty" return qty_field