[hotfix] allow only 5 character in company_abbr field in setup wizard (#9779)

This commit is contained in:
Makarand Bauskar 2017-07-11 12:36:57 +05:30 committed by GitHub
parent 7d885432eb
commit 30f2bcbccc

View File

@ -68,13 +68,13 @@ var erpnext_slides = [
slide.get_input("company_name").on("change", function () {
var parts = slide.get_input("company_name").val().split(" ");
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");
slide.get_input("company_abbr").on("change", function () {
if (slide.get_input("company_abbr").val().length > 5) {
frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
slide.get_field("company_abbr").set_input("");
slide.get_field("company_abbr").set_value("");
}
});
}