[minor] [boot] moved load_country_and_currency to framework
This commit is contained in:
parent
430b4a77b4
commit
9dd25b35d7
@ -17,6 +17,8 @@ def boot_session(bootinfo):
|
|||||||
if webnotes.session['user']!='Guest':
|
if webnotes.session['user']!='Guest':
|
||||||
bootinfo['letter_heads'] = get_letter_heads()
|
bootinfo['letter_heads'] = get_letter_heads()
|
||||||
|
|
||||||
|
load_country_and_currency(bootinfo)
|
||||||
|
|
||||||
import webnotes.model.doctype
|
import webnotes.model.doctype
|
||||||
bootinfo['notification_settings'] = webnotes.doc("Notification Control",
|
bootinfo['notification_settings'] = webnotes.doc("Notification Control",
|
||||||
"Notification Control").get_values()
|
"Notification Control").get_values()
|
||||||
@ -37,6 +39,14 @@ def boot_session(bootinfo):
|
|||||||
bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center
|
bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center
|
||||||
from `tabCompany`""", as_dict=1, update={"doctype":":Company"})
|
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():
|
def get_letter_heads():
|
||||||
"""load letter heads with startup"""
|
"""load letter heads with startup"""
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user