From 016b64df6d0085137a7e1d9fe09e090d8c8f87f7 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Tue, 2 Jun 2026 22:42:32 +0200 Subject: [PATCH] fix(item): format integer numeric variant attributes without decimals (#55561) --- erpnext/stock/doctype/item/item.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index a37c0925b71..2261cb7733f 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -935,11 +935,17 @@ $.extend(erpnext.item, { if (!row.disabled) { if (row.numeric_values) { - fieldtype = "Float"; + const all_are_int = + flt(row.from_range) === cint(row.from_range) && + flt(row.to_range) === cint(row.to_range) && + flt(row.increment) === cint(row.increment); + fieldtype = all_are_int ? "Int" : "Float"; + const df = { fieldtype }; + const options = all_are_int ? { inline: 1 } : { always_show_decimals: true, inline: 1 }; desc = __("Min Value: {0}, Max Value: {1}, in Increments of: {2}", [ - frappe.format(row.from_range, { fieldtype: "Float" }, { always_show_decimals: true }), - frappe.format(row.to_range, { fieldtype: "Float" }, { always_show_decimals: true }), - frappe.format(row.increment, { fieldtype: "Float" }, { always_show_decimals: true }), + frappe.format(row.from_range, df, options), + frappe.format(row.to_range, df, options), + frappe.format(row.increment, df, options), ]); } else { fieldtype = "Data";