fix: Usability fixes in accountng dimensions
diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
index 8669629..e150958 100644
--- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
+++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
@@ -41,10 +41,10 @@
 
 	document_type: function(frm) {
 		frm.set_value('label', frm.doc.document_type);
-		frm.set_value('fieldname', frappe.scrub(frm.doc.document_type));
+		frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
 
 		frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
-			if (r.document_type) {
+			if (r && r.document_type) {
 				frm.set_df_property('document_type', 'description', "Document type is already set as dimension");
 			}
 		});