diff --git a/startup/boot.py b/startup/boot.py index 79f0a7bd04..ce446e9ecf 100644 --- a/startup/boot.py +++ b/startup/boot.py @@ -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