Correct bug in abbr cause by missing " " separator (#19605)

Only 1 letter ABBR is generated after typing in a COMPANY NAME separated by spaces. This is due to missing " " value in split method.

For example: 

Company Name:    ABC Multiple Industries
Generates Abbr:     A
Correct Abbr should be:  AMI

This is caused by mission " " in split method.
This commit is contained in:
Joseph Marie Alba 2019-11-19 17:24:09 +08:00 committed by Nabin Hait
parent 776ff2f75d
commit 2578d49b84

View File

@ -29,7 +29,8 @@ frappe.ui.form.on("Company", {
company_name: function(frm) {
if(frm.doc.__islocal) {
let parts = frm.doc.company_name.split();
# add missing " " arg in split method
let parts = frm.doc.company_name.split(" ");
let abbr = $.map(parts, function (p) {
return p? p.substr(0, 1) : null;
}).join("");