Merge branch 'master' of github.com:webnotes/erpnext into unicode
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index 4487c89..52cb5fd 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -18,7 +18,7 @@
 wn.require('erpnext/support/doctype/communication/communication.js');
 
 cur_frm.cscript.refresh = function(doc, cdt, cdn){
-    erpnext.hide_naming_series();
+	erpnext.hide_naming_series();
 	
 	cur_frm.clear_custom_buttons();
 	if(doc.docstatus == 1) {
@@ -62,7 +62,6 @@
 // fetch
 // ===============================================================
 cur_frm.cscript.set_fetch = function() {
-
 	// item
 	cur_frm.add_fetch('item_code', 'item_name', 'item_name');
 	cur_frm.add_fetch('item_code', 'stock_uom', 'uom');
@@ -71,7 +70,6 @@
 	cur_frm.add_fetch('item_code', 'brand', 'brand');
 
 	// customer
-
 }
 
 // hide - unhide fields on basis of enquiry_from lead or customer
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 5e7828b..c400143 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -88,14 +88,10 @@
 						'cost_center': doc.fields.get('cost_center'),
 						'warehouse': doc.fields.get('warehouse')
 					}
-					fields_dict = obj.get_item_details(arg, self)
-					if fields_dict:
-						doc.fields.update(fields_dict)
-					#ret = obj.get_item_defaults(arg)
-					#for r in ret:
-					#	if not doc.fields.get(r):
-					#		doc.fields[r] = ret[r]					
-
+					res = obj.get_item_details(arg, self) or {}
+					for r in res:
+						if not doc.fields.get(r):
+							doc.fields[r] = res[r]
 
 	# Re-calculates Basic Rate & amount based on Price List Selected
 	# --------------------------------------------------------------