From 374b340e734a4a32173cabc8e65d9c8ceb465afe Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 1 Jul 2026 23:27:51 +0530 Subject: [PATCH] fix(item-attribute): clear attribute values when marking numeric Marking an attribute numeric hides the Item Attribute Values grid but leaves its rows in the doc, whose mandatory Attribute Value / Abbreviation block the save client-side before the server can clear them. Clear the table on the client too so the save goes through. Co-Authored-By: Claude Opus 4.8 (cherry picked from commit 4afbd4d3d9de4414744870c0c17c9ef504928d55) --- .../stock/doctype/item_attribute/item_attribute.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item_attribute/item_attribute.js b/erpnext/stock/doctype/item_attribute/item_attribute.js index 22c7978ac3c..d6f0f259174 100644 --- a/erpnext/stock/doctype/item_attribute/item_attribute.js +++ b/erpnext/stock/doctype/item_attribute/item_attribute.js @@ -1,4 +1,13 @@ // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on("Item Attribute", {}); +frappe.ui.form.on("Item Attribute", { + numeric_values(frm) { + // Numeric attributes have no discrete values; drop the rows so their + // mandatory Attribute Value / Abbreviation don't block the save. + if (frm.doc.numeric_values) { + frm.clear_table("item_attribute_values"); + frm.refresh_field("item_attribute_values"); + } + }, +});