brotherton-erpnext/patches/november_2012/add_theme_to_profile.py

18 lines
582 B
Python
Raw Normal View History

2013-11-20 07:29:58 +00:00
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.clear_perms("Profile")
webnotes.reload_doc("core", "doctype", "profile")
2013-06-07 09:39:45 +00:00
webnotes.conn.sql("""delete from `tabDefaultValue` where defkey='theme'""")
webnotes.delete_doc("Page", "profile-settings")
return
for name in webnotes.conn.sql("""select name from tabProfile"""):
theme = webnotes.conn.get_default("theme", name[0])
if theme:
webnotes.conn.set_value("Profile", name[0], "theme", theme)