Merge branch 'master' of github.com:webnotes/erpnext into responsive

Conflicts:
	patches/patch_list.py
	projects/doctype/project/project.py
	utilities/transaction_base.py
This commit is contained in:
Anand Doshi
2013-06-10 15:25:07 +05:30
34 changed files with 989 additions and 114 deletions

View File

@@ -0,0 +1,21 @@
import webnotes
def execute():
# delete orphaned Event User
webnotes.conn.sql("""delete from `tabEvent User`
where not exists(select name from `tabEvent` where `tabEvent`.name = `tabEvent User`.parent)""")
for dt in ["Lead", "Opportunity", "Project"]:
for ref_name in webnotes.conn.sql_list("""select ref_name
from `tabEvent` where ref_type=%s and ifnull(starts_on, '')='' """, dt):
if webnotes.conn.exists(dt, ref_name):
controller = webnotes.get_obj(dt, ref_name)
if dt == "Project":
controller.add_calendar_event()
else:
controller.delete_events()
controller._add_calendar_event()
else:
# remove events where ref doc doesn't exist
webnotes.delete_doc("Event", webnotes.conn.sql_list("""select name from `tabEvent`
where ref_type=%s and ref_name=%s""", (dt, ref_name)))

View File

@@ -259,4 +259,6 @@ patch_list = [
"patches.may_2013.p08_change_item_wise_tax",
"patches.june_2013.p01_update_bom_exploded_items",
"patches.june_2013.p02_update_project_completed",
"execute:webnotes.delete_doc('DocType', 'System Console')",
"patches.june_2013.p04_fix_event_for_lead_oppty_project",
]