mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 07:28:39 +00:00
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 <noreply@anthropic.com> (cherry picked from commit4afbd4d3d9) (cherry picked from commit374b340e73)
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// 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");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user