Fix related to user_default
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index a842006..d82e55c 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -68,7 +68,7 @@
 			$.each(r.message, function(i, v) {
 				$('<option>').html(v).attr('value', v).appendTo(wrapper.$company_select);
 			});
-			wrapper.$company_select.val(frappe.defaults.get_default("company") || r[0]).change();
+			wrapper.$company_select.val(frappe.defaults.get_user_default("company") || r[0]).change();
 		}
 	});
 }
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 9b6fcae..f1517a7 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -8,7 +8,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		},
 		{
 			"fieldname":"account",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 1437fde..f33e659 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -8,7 +8,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		},
 		{
 			"fieldname":"account",
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
index 4bf5d22..6a9bba2 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
@@ -22,7 +22,7 @@
 			label: frappe._("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_default("company")
+			default: frappe.defaults.get_user_default("company")
 		},
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
index 5f6d631..6bbcdfa 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
@@ -45,7 +45,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
index f54b94b..7788009 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
@@ -39,7 +39,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
index f2e9a9d..50c8d36 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
@@ -42,7 +42,7 @@
 			label: frappe._("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_default("company")
+			default: frappe.defaults.get_user_default("company")
 		},
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.js b/erpnext/accounts/report/purchase_register/purchase_register.js
index 10bd9aa..bde7425 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.js
+++ b/erpnext/accounts/report/purchase_register/purchase_register.js
@@ -39,7 +39,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js
index 683027a..bd8f690 100644
--- a/erpnext/accounts/report/sales_register/sales_register.js
+++ b/erpnext/accounts/report/sales_register/sales_register.js
@@ -39,7 +39,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js
index 0b33d8e..f6a29fb 100644
--- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js
+++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js
@@ -29,7 +29,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js
index d1561c7..cd9accc 100644
--- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js
+++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js
@@ -29,7 +29,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
index 0e9231e..fdd4db1 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
-	cur_frm.set_value("company", frappe.defaults.get_default("company"))
+	cur_frm.set_value("company", frappe.defaults.get_user_default("company"))
 	cur_frm.set_value("use_multi_level_bom", 1)
 }
 
diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js
index db4b15d..fee8b39 100644
--- a/erpnext/public/js/purchase_trends_filters.js
+++ b/erpnext/public/js/purchase_trends_filters.js
@@ -36,7 +36,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		},
 	];
 }
\ No newline at end of file
diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js
index 65b6bcf..89e52f1 100644
--- a/erpnext/public/js/sales_trends_filters.js
+++ b/erpnext/public/js/sales_trends_filters.js
@@ -36,7 +36,7 @@
 			"label": frappe._("Company"),
 			"fieldtype": "Link",
 			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			"default": frappe.defaults.get_user_default("company")
 		},	
 	];
 }
\ No newline at end of file
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 66cd501..2f89470 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -9,7 +9,7 @@
 		var me = this;
 		if(this.frm.doc.__islocal) {
 			var today = get_today(),
-				currency = frappe.defaults.get_default("currency");
+				currency = frappe.defaults.get_user_default("currency");
 			
 			$.each({
 				posting_date: today,
@@ -18,8 +18,8 @@
 				currency: currency,
 				price_list_currency: currency,
 				status: "Draft",
-				company: frappe.defaults.get_default("company"),
-				fiscal_year: frappe.defaults.get_default("fiscal_year"),
+				company: frappe.defaults.get_user_default("company"),
+				fiscal_year: frappe.defaults.get_user_default("fiscal_year"),
 				is_subcontracted: "No",
 			}, function(fieldname, value) {
 				if(me.frm.fields_dict[fieldname] && !me.frm.doc[fieldname])
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 12eb5fb..c5d3e0b 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -31,7 +31,7 @@
 	add_applicable_territory: function() {
 		if(cur_frm.doc.__islocal && 
 			frappe.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) {
-				var default_territory = frappe.defaults.get_default("territory");
+				var default_territory = frappe.defaults.get_user_default("territory");
 				if(default_territory) {
 					var territory = frappe.model.add_child(cur_frm.doc, "Applicable Territory", 
 						"valid_for_territories");
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index f243758..06cf4b1 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -22,8 +22,8 @@
 			set_multiple(cdt, cdn, { status:'Draft' });
 		if(!this.frm.doc.date) 
 			this.frm.doc.transaction_date = date.obj_to_str(new Date());
-		if(!this.frm.doc.company && frappe.defaults.get_default("company")) 
-			set_multiple(cdt, cdn, { company:frappe.defaults.get_default("company") });
+		if(!this.frm.doc.company && frappe.defaults.get_user_default("company")) 
+			set_multiple(cdt, cdn, { company:frappe.defaults.get_user_default("company") });
 		if(!this.frm.doc.fiscal_year && sys_defaults.fiscal_year)
 			set_multiple(cdt, cdn, { fiscal_year:sys_defaults.fiscal_year });
 	
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
index 608097d..9681cdc 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
@@ -33,7 +33,7 @@
 			label: frappe._("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_default("company")
+			default: frappe.defaults.get_user_default("company")
 		},
 		{
 			fieldname:"item_group",