[minor] [boot] moved load_country_and_currency to framework

This commit is contained in:
Rushabh Mehta 2013-09-03 17:36:41 +05:30
parent 430b4a77b4
commit 9dd25b35d7

View File

@ -16,7 +16,9 @@ def boot_session(bootinfo):
if webnotes.session['user']!='Guest':
bootinfo['letter_heads'] = get_letter_heads()
load_country_and_currency(bootinfo)
import webnotes.model.doctype
bootinfo['notification_settings'] = webnotes.doc("Notification Control",
"Notification Control").get_values()
@ -36,7 +38,15 @@ def boot_session(bootinfo):
bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center
from `tabCompany`""", as_dict=1, update={"doctype":":Company"})
def load_country_and_currency(bootinfo):
if bootinfo.control_panel.country and \
webnotes.conn.exists("Country", bootinfo.control_panel.country):
bootinfo["docs"] += [webnotes.doc("Country", bootinfo.control_panel.country)]
bootinfo["docs"] += webnotes.conn.sql("""select * from tabCurrency
where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"})
def get_letter_heads():
"""load letter heads with startup"""
import webnotes