From 2bea9ae2a5d33e88edb9d5e60c514ad2cb7096fc Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 9 Jun 2026 17:57:54 +0530 Subject: [PATCH 1/3] fix: show inactive product bundles in item where used (#55769) (cherry picked from commit 6201fefdfba02f5255b91827a8ee77898dc50be6) # Conflicts: # erpnext/stock/report/item_where_used/item_where_used.py --- .../stock/report/item_where_used/item_where_used.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/stock/report/item_where_used/item_where_used.py b/erpnext/stock/report/item_where_used/item_where_used.py index 1d53ecad90b..730091ed42e 100644 --- a/erpnext/stock/report/item_where_used/item_where_used.py +++ b/erpnext/stock/report/item_where_used/item_where_used.py @@ -294,8 +294,13 @@ def get_product_bundle_component_rows(item): def get_product_bundle_parent_rows(item): rows = frappe.get_all( "Product Bundle", +<<<<<<< HEAD filters={"new_item_code": item, "disabled": 0, "docstatus": 0}, fields=["name", "new_item_code", "disabled"], +======= + filters={"new_item_code": item, "docstatus": 1}, + fields=["name", "new_item_code", "is_active", "disabled"], +>>>>>>> 6201fefdfb (fix: show inactive product bundles in item where used (#55769)) order_by="name asc", ) @@ -463,8 +468,13 @@ def get_product_bundle_map(bundle_names): row.name: row for row in frappe.get_all( "Product Bundle", +<<<<<<< HEAD filters={"name": ["in", bundle_names], "disabled": 0, "docstatus": 0}, fields=["name", "new_item_code", "disabled"], +======= + filters={"name": ["in", bundle_names], "docstatus": 1}, + fields=["name", "new_item_code", "is_active", "disabled"], +>>>>>>> 6201fefdfb (fix: show inactive product bundles in item where used (#55769)) ) } From 8e25189d7d2679f762952aa0f7cbe009c1f7b961 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 10 Jun 2026 10:14:23 +0530 Subject: [PATCH 2/3] chore: resolve conflicts --- .../stock/report/item_where_used/item_where_used.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/erpnext/stock/report/item_where_used/item_where_used.py b/erpnext/stock/report/item_where_used/item_where_used.py index 730091ed42e..a2b333bfb8f 100644 --- a/erpnext/stock/report/item_where_used/item_where_used.py +++ b/erpnext/stock/report/item_where_used/item_where_used.py @@ -294,13 +294,8 @@ def get_product_bundle_component_rows(item): def get_product_bundle_parent_rows(item): rows = frappe.get_all( "Product Bundle", -<<<<<<< HEAD - filters={"new_item_code": item, "disabled": 0, "docstatus": 0}, - fields=["name", "new_item_code", "disabled"], -======= filters={"new_item_code": item, "docstatus": 1}, fields=["name", "new_item_code", "is_active", "disabled"], ->>>>>>> 6201fefdfb (fix: show inactive product bundles in item where used (#55769)) order_by="name asc", ) @@ -468,13 +463,8 @@ def get_product_bundle_map(bundle_names): row.name: row for row in frappe.get_all( "Product Bundle", -<<<<<<< HEAD - filters={"name": ["in", bundle_names], "disabled": 0, "docstatus": 0}, - fields=["name", "new_item_code", "disabled"], -======= filters={"name": ["in", bundle_names], "docstatus": 1}, fields=["name", "new_item_code", "is_active", "disabled"], ->>>>>>> 6201fefdfb (fix: show inactive product bundles in item where used (#55769)) ) } From b1895e9a9a0747715813fca59e2a196b6d2bf58f Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 10 Jun 2026 19:29:42 +0530 Subject: [PATCH 3/3] fix: adapt Product Bundle queries to v16 schema On version-16-hotfix, Product Bundle has no `is_active` field and is not submittable (docstatus is always 0), so the backported queries crashed with "Unknown column 'is_active'" and would otherwise have matched no rows. Keep v16's `docstatus: 0` and derive activity from `disabled`, as the surrounding build_row calls already do. Co-Authored-By: Claude Fable 5 --- erpnext/stock/report/item_where_used/item_where_used.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/report/item_where_used/item_where_used.py b/erpnext/stock/report/item_where_used/item_where_used.py index a2b333bfb8f..2c193b4a6bd 100644 --- a/erpnext/stock/report/item_where_used/item_where_used.py +++ b/erpnext/stock/report/item_where_used/item_where_used.py @@ -294,8 +294,8 @@ def get_product_bundle_component_rows(item): def get_product_bundle_parent_rows(item): rows = frappe.get_all( "Product Bundle", - filters={"new_item_code": item, "docstatus": 1}, - fields=["name", "new_item_code", "is_active", "disabled"], + filters={"new_item_code": item, "docstatus": 0}, + fields=["name", "new_item_code", "disabled"], order_by="name asc", ) @@ -463,8 +463,8 @@ def get_product_bundle_map(bundle_names): row.name: row for row in frappe.get_all( "Product Bundle", - filters={"name": ["in", bundle_names], "docstatus": 1}, - fields=["name", "new_item_code", "is_active", "disabled"], + filters={"name": ["in", bundle_names], "docstatus": 0}, + fields=["name", "new_item_code", "disabled"], ) }