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

This commit is contained in:
Anand Doshi
2013-06-10 15:38:31 +05:30
4 changed files with 11 additions and 8 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`