fix(item): format integer numeric variant attributes without decimals (backport #55561) (#55563)

* fix(item): format integer numeric variant attributes without decimals (#55561)

(cherry picked from commit 016b64df6d)

# Conflicts:
#	erpnext/stock/doctype/item/item.js

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2026-06-02 22:59:43 +02:00
committed by GitHub
parent ccbca57420
commit 4772799db2

View File

@@ -740,14 +740,18 @@ $.extend(erpnext.item, {
if (!row.disabled) { if (!row.disabled) {
if (row.numeric_values) { if (row.numeric_values) {
fieldtype = "Float"; const all_are_int =
desc = flt(row.from_range) === cint(row.from_range) &&
"Min Value: " + flt(row.to_range) === cint(row.to_range) &&
row.from_range + flt(row.increment) === cint(row.increment);
" , Max Value: " + fieldtype = all_are_int ? "Int" : "Float";
row.to_range + const df = { fieldtype };
", in Increments of: " + const options = all_are_int ? { inline: 1 } : { always_show_decimals: true, inline: 1 };
row.increment; desc = __("Min Value: {0}, Max Value: {1}, in Increments of: {2}", [
frappe.format(row.from_range, df, options),
frappe.format(row.to_range, df, options),
frappe.format(row.increment, df, options),
]);
} else { } else {
fieldtype = "Data"; fieldtype = "Data";
desc = ""; desc = "";