Minor fix, if no default company
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index b57b765..4bb3302 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -71,7 +71,7 @@
 
 	warehouse: function(doc) {
 		return {
-			filters: [["Warehouse", "company", "in", ["", doc.company]]]
+			filters: [["Warehouse", "company", "in", ["", cstr(doc.company)]]]
 		}
 	}
 });
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 1024198..7274ece 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -92,7 +92,7 @@
 	set_default_account: function() {
 		var me = this;
 
-		if(cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
+		if(cint(frappe.defaults.get_default("auto_accounting_for_stock")) && this.frm.doc.company) {
 			var account_for = "stock_adjustment_account";
 
 			if (this.frm.doc.purpose == "Purchase Return")