removed control panel

This commit is contained in:
Rushabh Mehta
2014-04-04 12:00:36 +05:30
parent 312ba99e71
commit 558a9aabfb
11 changed files with 20 additions and 29 deletions

View File

@@ -332,8 +332,7 @@ class Company(Document):
for d in acc_list_common:
self.add_acc(d)
country = frappe.db.sql("select value from tabSingles where field = 'country' and doctype = 'Control Panel'")
country = country and cstr(country[0][0]) or ''
country = frappe.db.get_default("country")
# load taxes (only for India)
if country == 'India':

View File

@@ -29,7 +29,7 @@ class GlobalDefaults(Document):
def on_update(self):
"""update defaults"""
self.validate_session_expiry()
self.update_control_panel()
self.set_country_and_timezone()
for key in keydict:
frappe.db.set_default(key, self.get(keydict[key], ''))
@@ -59,14 +59,9 @@ class GlobalDefaults(Document):
frappe.msgprint("""Session Expiry must be in format hh:mm""",
raise_exception=1)
def update_control_panel(self):
cp_doc = frappe.get_doc("Control Panel")
if self.country:
cp_doc.country = self.country
if self.time_zone:
cp_doc.time_zone = self.time_zone
cp_doc.ignore_permissions = True
cp_doc.save()
def set_country_and_timezone(self):
frappe.db.set_default("country", self.country)
frappe.db.set_default("time_zone", self.time_zone)
def get_defaults(self):
return frappe.defaults.get_defaults()