frappe/frappe#478, frappe tests pass, .txt renamed to .json
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 2f28e1a..69d27ba 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -49,8 +49,7 @@
 		bin_wrapper.insert()
 		bin_obj = bin_wrapper.make_controller()
 	else:
-		from frappe.model.code import get_obj
-		bin_obj = get_obj('Bin', bin)
+				bin_obj = frappe.get_doc('Bin', bin)
 	return bin_obj
 
 def update_bin(args):