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 9ba2015..e2b9c96 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,4 +1,7 @@
erpnext.updates = [
+ ["27th November 2012", [
+ "Communication: Made common communication thread and added it in Lead, Contact.",
+ ]],
["26th November 2012", [
"Email: Added User Signature",
"Support Ticket: Added link to Lead / Contact. If incoming ticket is not from an existing Lead / Contact, create a new Lead",
diff --git a/patches/november_2012/cancelled_bom_patch.py b/patches/november_2012/cancelled_bom_patch.py
new file mode 100644
index 0000000..3420a08
--- /dev/null
+++ b/patches/november_2012/cancelled_bom_patch.py
@@ -0,0 +1,14 @@
+import webnotes
+
+def execute():
+ cancelled_boms = webnotes.conn.sql("""select name from `tabBOM`
+ where docstatus = 2""")
+
+ for bom in cancelled_boms:
+ webnotes.conn.sql("""update `tabBOM` set is_default=0, is_active='No'
+ where name=%s""", (bom[0],))
+
+ webnotes.conn.sql("""update `tabItem` set default_bom=null
+ where default_bom=%s""", (bom[0],))
+
+
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 124fdea..5cacfb2 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -685,6 +685,10 @@
},
{
'patch_module': 'patches.november_2012',
+ 'patch_file': 'cancelled_bom_patch',
+ },
+ {
+ 'patch_module': 'patches.november_2012',
'patch_file': 'communication_sender_and_recipient',
},
]
\ No newline at end of file