fix: reportview average of ints should be float (#26284)

This commit is contained in:
Ankush Menat 2024-05-02 12:11:15 +05:30 committed by GitHub
parent 3db923995c
commit 8bd40b38e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -327,6 +327,9 @@ frappe.ui.GroupBy = class {
if (this.aggregate_function === "sum") {
docfield.label = __("Sum of {0}", [__(docfield.label, null, docfield.parent)]);
} else {
if (docfield.fieldtype == "Int") {
docfield.fieldtype = "Float"; // average of ints can be a float
}
docfield.label = __("Average of {0}", [__(docfield.label, null, docfield.parent)]);
}
}