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.
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 313de67..81c5f02 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -29,7 +29,8 @@
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("");