Merge branch 'master' into stable
diff --git a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
index 2a17817..6e99af9 100644
--- a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
+++ b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py
@@ -135,7 +135,7 @@
 		""" Uncheck others if current one is selected as default, update default bom in item master"""
 
 		if self.doc.is_default and self.doc.is_active == 'Yes':
-			sql("update `tabBill Of Materials` set is_default = 0 where name != %s", self.doc.name)
+			sql("update `tabBill Of Materials` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item))
 
 			# update default bom in Item Master
 			sql("update `tabItem` set default_bom = %s where name = %s", (self.doc.name, self.doc.item))
diff --git a/index.html b/index.html
index bc3673c..b53b0a4 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
 	<meta charset="utf-8">
 	<title>ERPNext</title>
 	<meta name="author" content="">
-	<script type="text/javascript">window._version_number="49"
+	<script type="text/javascript">window._version_number="51"
 
 wn={}
 wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}}
diff --git a/version.num b/version.num
index 2e66562..7003e7f 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-49
\ No newline at end of file
+51
\ No newline at end of file