[hotfix] allow only 5 character in company_abbr field in setup wizard (#9779)
This commit is contained in:
parent
7d885432eb
commit
30f2bcbccc
@ -68,13 +68,13 @@ var erpnext_slides = [
|
|||||||
slide.get_input("company_name").on("change", function () {
|
slide.get_input("company_name").on("change", function () {
|
||||||
var parts = slide.get_input("company_name").val().split(" ");
|
var parts = slide.get_input("company_name").val().split(" ");
|
||||||
var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join("");
|
var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join("");
|
||||||
slide.get_field("company_abbr").set_input(abbr.slice(0, 5).toUpperCase());
|
slide.get_field("company_abbr").set_value(abbr.slice(0, 5).toUpperCase());
|
||||||
}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");
|
}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");
|
||||||
|
|
||||||
slide.get_input("company_abbr").on("change", function () {
|
slide.get_input("company_abbr").on("change", function () {
|
||||||
if (slide.get_input("company_abbr").val().length > 5) {
|
if (slide.get_input("company_abbr").val().length > 5) {
|
||||||
frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
|
frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
|
||||||
slide.get_field("company_abbr").set_input("");
|
slide.get_field("company_abbr").set_value("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user