[patch] [fix] event for project, oppty, lead

This commit is contained in:
Anand Doshi
2013-06-10 15:38:01 +05:30
parent dec9a165ac
commit 670199b9c6
4 changed files with 10 additions and 7 deletions

View File

@@ -9,7 +9,10 @@ def execute():
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):
webnotes.get_obj(dt, ref_name).add_calendar_event()
if dt in ["Lead", "Opportunity"]:
webnotes.get_obj(dt, ref_name).add_calendar_event(force=True)
else:
webnotes.get_obj(dt, ref_name).add_calendar_event()
else:
# remove events where ref doc doesn't exist
webnotes.delete_doc("Event", webnotes.conn.sql_list("""select name from `tabEvent`