Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 4d5f2bf..09befee 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,5 +1,12 @@
 erpnext.updates = [
-	["4rd December 2012", [
+	["5th December 2012", [
+		"Production Order is now linked with sales order.",
+		"Production Planning Tool: The field 'Allow SA items as raw material' has been renamed to 'Use multi-level BOM', 'Include in plan' column from SO table has been deleted",
+		"Batch nos are now filtered with item and available qty",
+		"BOM: 'Update Costing' button has been deleted, once submitted cost are fixed.",
+		"[For indian customer only] Deprecated TDS related documents and fields. Old TDS amount added into tax table in Purchase Invoice and entries table in case of JV",
+	]],
+	["4th December 2012", [
 		"POS / Mode of Payment: Select default bank / cash account in Mode of Payment and it will be automatically selected in POS Invoice.",
 		"Email: Add contact name as 'Dear so-and-so' in Email.",
 		"Report Builder: Remember last column setup for users",
@@ -9,6 +16,7 @@
 		"Linked With: Added new Linked with in all Forms.",
 		"Rename Tool: Documents that can be renamed will have a 'Rename' option in the sidebar (wherever applicable).",
 		"Chart of Accounts: Ability to rename / delete from Chart of Accounts.",
+		"Delivery and Billing status now updated in sales order, if POS made against that sales order"
 	]],
 	["30th November 2012", [
 		"Auto Notifications: System will prompt user with pre-set message for auto-notification.",
diff --git a/production/doctype/bom/bom.js b/production/doctype/bom/bom.js
index dd32fe4..aef14a9 100644
--- a/production/doctype/bom/bom.js
+++ b/production/doctype/bom/bom.js
@@ -67,7 +67,7 @@
 		calculate_total(doc);
 	}
 
-	var bom_no = (d.bom_no!=null) ? d.bom_no:''
+	var bom_no = (d.bom_no!=null) ? d.bom_no: ''
 	if (d.item_code) {
 		arg = {'item_code': d.item_code, 'bom_no': bom_no, 'qty': d.qty};
 		get_server_fields('get_bom_material_detail', JSON.stringify(arg), 'bom_materials', doc, dt, dn, 1, callback);
diff --git a/production/doctype/bom/bom.py b/production/doctype/bom/bom.py
index 0b634d7..c0ef31c 100644
--- a/production/doctype/bom/bom.py
+++ b/production/doctype/bom/bom.py
@@ -31,7 +31,8 @@
 		self.doclist = doclist
 
 	def autoname(self):
-		last_name = sql("select max(name) from `tabBOM` where name like 'BOM/%s/%%'" % self.doc.item)
+		last_name = sql("""select max(name) from `tabBOM` 
+			where name like 'BOM/%s/%%'""" % self.doc.item)
 		if last_name:
 			idx = cint(cstr(last_name[0][0]).split('/')[-1]) + 1
 		else:
@@ -40,9 +41,10 @@
 
 
 	def get_item_det(self, item_code):
-		item = sql("""select name, is_asset_item, is_purchase_item, docstatus, is_sub_contracted_item,
-			description, stock_uom, default_bom, last_purchase_rate, standard_rate, is_manufactured_item from `tabItem` 
-			where item_code = %s""", item_code, as_dict = 1)
+		item = sql("""select name, is_asset_item, is_purchase_item, docstatus,
+		 	is_sub_contracted_item, description, stock_uom, default_bom, 
+			last_purchase_rate, standard_rate, is_manufactured_item 
+			from `tabItem` where item_code = %s""", item_code, as_dict = 1)
 
 		return item
 
@@ -86,8 +88,8 @@
 
 	def get_bom_material_detail(self, arg):
 		""" Get raw material details like uom, desc and rate"""
-
-		arg = eval(arg)
+		import json
+		arg = json.loads(arg)
 		item = self.get_item_det(arg['item_code'])
 		self.validate_rm_item(item)