brotherton-erpnext/patches/february_2013/p01_event.py
2013-11-20 13:00:28 +05:30

18 lines
596 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "event")
webnotes.conn.sql("""update tabEvent set subject=description""")
webnotes.conn.sql("""update tabEvent set description = concat(description, "\n", notes)
where ifnull(notes,"") != "" """)
webnotes.conn.sql("""update tabEvent set starts_on = timestamp(event_date, event_hour)""")
webnotes.conn.sql("""update tabEvent set ends_on = timestampadd(hour, 1, starts_on)""")